feat: Updating id key for usage in views, for typesafe keys
This commit is contained in:
@@ -9,7 +9,7 @@ struct UserTable: HTML {
|
||||
let users: [User]
|
||||
|
||||
var content: some HTML {
|
||||
table(.id(.user(.table()))) {
|
||||
table {
|
||||
thead {
|
||||
tr {
|
||||
th { "Username" }
|
||||
@@ -18,13 +18,13 @@ struct UserTable: HTML {
|
||||
Button.add()
|
||||
.attributes(
|
||||
.hx.get(route: .user(.form)),
|
||||
.hx.target(.float),
|
||||
.hx.target(.id(.float)),
|
||||
.hx.swap(.outerHTML)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
tbody(.id(.user(.table(.body)))) {
|
||||
tbody(.id(.user(.table))) {
|
||||
for user in users {
|
||||
Row(user: user)
|
||||
}
|
||||
@@ -46,7 +46,7 @@ struct UserTable: HTML {
|
||||
td {
|
||||
Button.detail().attributes(
|
||||
.hx.get(route: .user(.get(id: user.id))),
|
||||
.hx.target(.float),
|
||||
.hx.target(.id(.float)),
|
||||
.hx.swap(.outerHTML),
|
||||
.hx.pushURL(true)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user