feat: Cleans up routes.

This commit is contained in:
2025-01-19 13:33:01 -05:00
parent 1c8748211c
commit b23dc6bf07
32 changed files with 958 additions and 1786 deletions

View File

@@ -51,8 +51,8 @@ struct EmployeeForm: HTML {
"Delete"
}
.attributes(
.hx.delete(route: .employee(.shared(.delete(id: employee.id)))),
.hx.confirm("Are you sure you want to delete this employee?"),
.hx.delete(route: .employee(.delete(id: employee.id))),
.hx.target("#employee_\(employee.id)"),
.hx.swap(.outerHTML.transition(true).swap("1s"))
)
@@ -75,7 +75,7 @@ struct EmployeeForm: HTML {
}
private var targetURL: SharedModels.ViewRoute {
guard let employee else { return .employee(.shared(.index)) }
return .employee(.shared(.get(id: employee.id)))
guard let employee else { return .employee(.index) }
return .employee(.get(id: employee.id))
}
}