Document enum parameter rule and fix call style

Add coredata guide section on using Go enum constants as named
SQL parameters instead of hardcoded string literals. Fix mixed
inline/multiline RenderJSON call in cookie banner handler.

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-04-14 17:05:35 +04:00
parent 7a50537bf4
commit 713623c7c0
2 changed files with 26 additions and 6 deletions

View File

@@ -167,10 +167,14 @@ func (h *Handler) handlePostConsent(w http.ResponseWriter, r *http.Request) {
return
}
httpserver.RenderJSON(w, http.StatusCreated, postConsentResponse{
ID: record.ID.String(),
VisitorID: record.VisitorID,
Action: string(record.Action),
CreatedAt: record.CreatedAt,
})
httpserver.RenderJSON(
w,
http.StatusCreated,
postConsentResponse{
ID: record.ID.String(),
VisitorID: record.VisitorID,
Action: string(record.Action),
CreatedAt: record.CreatedAt,
},
)
}