feat: Adds view route parsing tests.
This commit is contained in:
@@ -24,9 +24,9 @@ struct EmployeeForm: HTML {
|
||||
employee == nil
|
||||
? .hx.swap(.beforeEnd.transition(true).swap("0.5s"))
|
||||
: .hx.swap(.outerHTML.transition(true).swap("0.5s")),
|
||||
.custom(
|
||||
name: "hx-on::after-request",
|
||||
value: "if (event.detail.successful) toggleContent('float'); window.location.href='/employees';"
|
||||
.hx.on(
|
||||
.afterRequest,
|
||||
.ifSuccessful(.toggleContent(.float), .setWindowLocation(to: .employee(.index)))
|
||||
)
|
||||
) {
|
||||
div(.class("row")) {
|
||||
@@ -53,7 +53,7 @@ struct EmployeeForm: HTML {
|
||||
.attributes(
|
||||
.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.target(.id(.employee(.row(id: employee.id)))),
|
||||
.hx.swap(.outerHTML.transition(true).swap("1s"))
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user