feat: Refactoring route declarations.

This commit is contained in:
2025-01-26 01:16:59 -05:00
parent 0fad024350
commit 4dc928e1f4
34 changed files with 592 additions and 606 deletions

View File

@@ -53,7 +53,7 @@ struct LoggedIn: HTML, Sendable {
let next: String?
var content: some HTML {
div(
.hx.get(nextRoute ?? ViewRoute.router.path(for: .purchaseOrder(.index))),
.hx.get(nextRoute ?? SiteRoute.View.router.path(for: .purchaseOrder(.index))),
.hx.pushURL(true),
.hx.target(.body),
.hx.trigger(.event(.revealed)),
@@ -66,7 +66,9 @@ struct LoggedIn: HTML, Sendable {
// 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 SiteRoute.View.router.path(
for: .purchaseOrder(.search(.index(context: .employee, table: true)))
)
}
return next
}