feat: Refactoring route declarations.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user