feat: Adds api route tests. Tested user interface works as expected, still needs some work on vendors form.

This commit is contained in:
2025-01-20 16:44:12 -05:00
parent affd9b5d81
commit 410bbae1c8
23 changed files with 537 additions and 121 deletions

View File

@@ -40,7 +40,7 @@ struct VendorForm: HTML {
func makeForm(vendor: Vendor?) -> some HTML {
form(
.id("vendor-form"),
.id(.vendor(.form)),
vendor != nil ? .hx.put(route: targetURL) : .hx.post(route: targetURL),
.hx.target("#content"),
.hx.swap(.outerHTML)
@@ -63,7 +63,7 @@ struct VendorForm: HTML {
.style("font-size: 1.25em; padding: 10px 20px; border-radius: 10px;"),
.hx.delete(route: .vendor(.delete(id: vendor.id))),
.hx.confirm("Are you sure you want to delete this vendor?"),
.hx.target("#vendor_\(vendor.id)"),
.hx.target(.id(.vendor(.row(id: vendor.id)))),
.hx.swap(.outerHTML.transition(true).swap("1s")),
.custom(
name: "hx-on::after-request",