feat: Updates form routes and database routes to use id's in the url path.

This commit is contained in:
2026-01-09 09:25:37 -05:00
parent 9356ccb1c9
commit 30fddb9dce
27 changed files with 677 additions and 322 deletions

View File

@@ -126,20 +126,28 @@ struct EffectiveLengthsView: HTML, Sendable {
}
div(.class("card-actions justify-end pt-6 space-y-4 mt-auto")) {
// TODO: Delete.
TrashButton()
.attributes(
.hx.delete(
route: .project(
.detail(
effectiveLength.projectID, .equivalentLength(.delete(id: effectiveLength.id)))
)),
.hx.confirm("Are you sure?"),
.hx.target("#\(id)"),
.hx.swap(.outerHTML)
)
EditButton()
.attributes(.showModal(id: EffectiveLengthForm.id(effectiveLength)))
div(.class("join")) {
TrashButton()
.attributes(
.class("join-item"),
.hx.delete(
route: .project(
.detail(
effectiveLength.projectID,
.equivalentLength(.delete(id: effectiveLength.id))
)
)
),
.hx.confirm("Are you sure?"),
.hx.target("#\(id)"),
.hx.swap(.outerHTML)
)
EditButton()
.attributes(
.class("join-item"),
.showModal(id: EffectiveLengthForm.id(effectiveLength))
)
}
}
EffectiveLengthForm(effectiveLength: effectiveLength)