fix: Adds missing delete button from employee view.
This commit is contained in:
@@ -46,6 +46,17 @@ struct EmployeeForm: HTML {
|
||||
button(.type(.submit), .class("btn-primary")) {
|
||||
buttonLabel
|
||||
}
|
||||
if let employee {
|
||||
Button.danger {
|
||||
"Delete"
|
||||
}
|
||||
.attributes(
|
||||
.hx.delete("/api/v1/employees/\(employee.id)"),
|
||||
.hx.confirm("Are you sure you want to delete this employee?"),
|
||||
.hx.target("#employee_\(employee.id)"),
|
||||
.hx.swap(.outerHTML.transition(true).swap("1s"))
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user