feat: Updating id key for usage in views, for typesafe keys
This commit is contained in:
@@ -16,7 +16,7 @@ struct VendorTable: HTML {
|
||||
.attributes(
|
||||
.style("padding: 0px 10px;"),
|
||||
.hx.get(route: .vendor(.form)),
|
||||
.hx.target(.float),
|
||||
.hx.target(.id(.float)),
|
||||
.hx.swap(.outerHTML)
|
||||
)
|
||||
}
|
||||
@@ -34,7 +34,7 @@ struct VendorTable: HTML {
|
||||
let vendor: Vendor
|
||||
|
||||
var content: some HTML<HTMLTag.tr> {
|
||||
tr(.id("vendor_\(vendor.id)")) {
|
||||
tr(.id(.vendor(.row(id: vendor.id)))) {
|
||||
td { vendor.name.capitalized }
|
||||
td { "(\(vendor.branches?.count ?? 0)) Branches" }
|
||||
td {
|
||||
@@ -42,7 +42,7 @@ struct VendorTable: HTML {
|
||||
.attributes(
|
||||
.style("padding-left: 15px;"),
|
||||
.hx.get(route: .vendor(.get(id: vendor.id))),
|
||||
.hx.target("#float"),
|
||||
.hx.target(.id(.float)),
|
||||
.hx.pushURL(true),
|
||||
.hx.swap(.outerHTML)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user