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"))
|
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.ToLower(strings.TrimSpace(req.Email)),
|
||||||
strings.TrimSpace(req.Name),
|
strings.TrimSpace(req.Name),
|
||||||
req.Status,
|
req.Status,
|
||||||
|
|
|
@ -177,8 +177,7 @@ func handleUpdateTemplate(c echo.Context) error {
|
||||||
return echo.NewHTTPError(http.StatusBadRequest, err.Error())
|
return echo.NewHTTPError(http.StatusBadRequest, err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: PASSWORD HASHING.
|
res, err := app.queries.UpdateTemplate.Exec(id, o.Name, o.Body)
|
||||||
res, err := app.queries.UpdateTemplate.Exec(o.ID, o.Name, o.Body)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return echo.NewHTTPError(http.StatusInternalServerError,
|
return echo.NewHTTPError(http.StatusInternalServerError,
|
||||||
app.i18n.Ts("globals.messages.errorUpdating",
|
app.i18n.Ts("globals.messages.errorUpdating",
|
||||||
|
|
Loading…
Reference in New Issue