Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Fix incorrect ID handling in update handlers

Kailash Nadhf8e555dac545
diff --git a/cmd/subscribers.go b/cmd/subscribers.go
index 42f86e30..de9eb62b 100644
--- a/cmd/subscribers.go
+++ b/cmd/subscribers.go
@@ -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,
diff --git a/cmd/templates.go b/cmd/templates.go
index 6977b9a9..637989f3 100644
--- a/cmd/templates.go
+++ b/cmd/templates.go
@@ -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",