fix: fix ui reports

This commit is contained in:
Krispire Admin
2026-06-16 19:03:06 +05:30
parent 1cde0c0544
commit a63ef672bb
6 changed files with 36 additions and 12 deletions
+6 -1
View File
@@ -208,7 +208,12 @@ func (h *AdminHandler) ResolveReport(w http.ResponseWriter, r *http.Request) {
response.Error(w, http.StatusBadRequest, "type must be post, comment, or user")
return
}
resolved, err := h.svc.ResolveReport(r.Context(), reportType, id)
var in struct {
Note string `json:"note"`
}
// Body is optional/best-effort; an empty/missing note resolves with no note.
_ = json.NewDecoder(r.Body).Decode(&in)
resolved, err := h.svc.ResolveReport(r.Context(), reportType, id, strings.TrimSpace(in.Note))
if err != nil {
response.Error(w, http.StatusInternalServerError, "could not resolve report")
return