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:
@@ -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,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user