feat: Updating id key for usage in views, for typesafe keys
This commit is contained in:
@@ -17,7 +17,7 @@ struct EmployeeForm: HTML {
|
||||
}
|
||||
|
||||
var content: some HTML {
|
||||
Float(shouldDisplay: shouldShow, resetURL: "/employees") {
|
||||
Float(shouldDisplay: shouldShow, resetURL: .employee(.index)) {
|
||||
form(
|
||||
employee == nil ? .hx.post(route: targetURL) : .hx.put(route: targetURL),
|
||||
.hx.target(target),
|
||||
@@ -64,9 +64,9 @@ struct EmployeeForm: HTML {
|
||||
|
||||
private var target: HXTarget {
|
||||
guard let employee else {
|
||||
return .employee(.table)
|
||||
return .id(.employee(.table))
|
||||
}
|
||||
return .employee(.row(id: employee.id))
|
||||
return .id(.employee(.row(id: employee.id)))
|
||||
}
|
||||
|
||||
private var buttonLabel: String {
|
||||
|
||||
Reference in New Issue
Block a user