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

@@ -52,15 +52,23 @@ struct LoggedIn: HTML {
let next: String?
var content: some HTML {
div(
.hx.get(next ?? ViewRoute.router.path(for: .purchaseOrder(.index))),
.hx.get(nextRoute ?? ViewRoute.router.path(for: .purchaseOrder(.index))),
.hx.pushURL(true),
.hx.target("body"),
.hx.target(.body),
.hx.trigger(.event(.revealed)),
.hx.indicator(".hx-indicator")
) {
Img.spinner().attributes(.class("hx-indicator"))
}
}
// HACK: to get search route to work after login.
var nextRoute: String? {
if let next, next.contains("search") {
return ViewRoute.router.path(for: .purchaseOrder(.search(.index(context: .employee, table: true))))
}
return next
}
}
struct RouteHeaderView: HTML {