Fix incorrect ID handling in update handlers
This commit is contained in:
parent
93a710c9ae
commit
f8e555dac5
|
@ -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,
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue