Skip to content

Commit

Permalink
bug: fixup use of fiber context values
Browse files Browse the repository at this point in the history
  • Loading branch information
mkt95 committed Dec 21, 2023
1 parent 4f0bd60 commit 0d373eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/htmx-fiber-todo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/chasefleming/elem-go/attrs"
"github.com/chasefleming/elem-go/styles"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
)

// Todo model
Expand Down Expand Up @@ -54,7 +55,7 @@ func toggleTodoRoute(c *fiber.Ctx) error {
}

func addTodoRoute(c *fiber.Ctx) error {
newTitle := c.FormValue("newTodo")
newTitle := utils.CopyString(c.FormValue("newTodo"))
if newTitle != "" {
todos = append(todos, Todo{ID: len(todos) + 1, Title: newTitle, Done: false})
}
Expand Down

0 comments on commit 0d373eb

Please sign in to comment.