feat: Working on fixing todos.
This commit is contained in:
@@ -20,7 +20,7 @@ struct UserForm: HTML, Sendable {
|
||||
form(
|
||||
.id(.user(.form)),
|
||||
.class("user-form"),
|
||||
.hx.post(context.targetURL),
|
||||
.hx.post(route: context.targetURL),
|
||||
.hx.pushURL(context.pushURL),
|
||||
.hx.target(context.target),
|
||||
.hx.swap(context == .create ? .afterBegin.transition(true).swap("0.5s") : .outerHTML),
|
||||
@@ -101,18 +101,12 @@ struct UserForm: HTML, Sendable {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Return a ViewRoute.
|
||||
var targetURL: String {
|
||||
var targetURL: ViewRoute {
|
||||
switch self {
|
||||
case .create:
|
||||
return "/users"
|
||||
return .user(.index)
|
||||
case .login:
|
||||
return "/login"
|
||||
// let path = "/login"
|
||||
// if let next {
|
||||
// return "\(path)?next=\(next)"
|
||||
// }
|
||||
// return path
|
||||
return .login(.index())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user