feat: Adds api route tests. Tested user interface works as expected, still needs some work on vendors form.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user