Skip to content

Commit

Permalink
Fix incorrect ID handling in update handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Mar 9, 2021
1 parent 93a710c commit f8e555d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/subscribers.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func handleUpdateSubscriber(c echo.Context) error {
return echo.NewHTTPError(http.StatusBadRequest, app.i18n.T("subscribers.invalidName"))
}

_, err := app.queries.UpdateSubscriber.Exec(req.ID,
_, err := app.queries.UpdateSubscriber.Exec(id,
strings.ToLower(strings.TrimSpace(req.Email)),
strings.TrimSpace(req.Name),
req.Status,
Expand Down
3 changes: 1 addition & 2 deletions cmd/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ func handleUpdateTemplate(c echo.Context) error {
return echo.NewHTTPError(http.StatusBadRequest, err.Error())
}

// TODO: PASSWORD HASHING.
res, err := app.queries.UpdateTemplate.Exec(o.ID, o.Name, o.Body)
res, err := app.queries.UpdateTemplate.Exec(id, o.Name, o.Body)
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError,
app.i18n.Ts("globals.messages.errorUpdating",
Expand Down

0 comments on commit f8e555d

Please sign in to comment.