db, handlers, and interfaces
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
package partials
|
||||
|
||||
import "michaelthomson.dev/mthomson/go-todos-app/db"
|
||||
import "michaelthomson.dev/mthomson/go-todos-app/models"
|
||||
|
||||
func todoId(todo db.Todo) string {
|
||||
func todoId(todo models.Todo) string {
|
||||
return "todo-" + todo.Id.String()
|
||||
}
|
||||
|
||||
templ Todo(todo db.Todo) {
|
||||
templ Todo(todo models.Todo) {
|
||||
<div id={ todoId(todo) }>
|
||||
{ todo.Id.String() }: { todo.Name }
|
||||
{ todo.Name }
|
||||
<button hx-delete={ "/todos/" + todo.Id.String() } hx-target={ "#" + todoId(todo) } hx-swap="delete">Delete</button>
|
||||
</div>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user