From 67b3282831b48fdaaf7408c733c91444f1709745 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Mon, 13 Apr 2026 09:24:01 -0400 Subject: [PATCH] fix(handlers): Correct database call parameters in processing issues handler Fix ResolveProcessingIssue and DeleteProcessingIssue methods to use proper parameter structs instead of individual arguments. Changes: - ResolveProcessingIssue: Use database.ResolveProcessingIssueParams struct with ID and MediaItemID fields instead of separate arguments - DeleteProcessingIssue: Wrap issueID in pgtype.UUID struct - Use map[string]any instead of map[string]interface{} for JSON responses These changes align with the sqlc-generated database interface and ensure type-safe parameter passing to the database layer. --- internal/handlers/processing_issues.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/handlers/processing_issues.go b/internal/handlers/processing_issues.go index 3ba57ae..3b64226 100644 --- a/internal/handlers/processing_issues.go +++ b/internal/handlers/processing_issues.go @@ -107,8 +107,10 @@ func (h *ProcessingIssuesHandler) ResolveProcessingIssue(c *echo.Context) error _, err = h.db.ResolveProcessingIssue( c.Request().Context(), - issueID, - pgtype.UUID{Bytes: mediaItemID, Valid: true}, + database.ResolveProcessingIssueParams{ + ID: pgtype.UUID{Bytes: issueID, Valid: true}, + MediaItemID: pgtype.UUID{Bytes: mediaItemID, Valid: true}, + }, ) if err != nil { return c.JSON(http.StatusInternalServerError, map[string]string{"error": "Failed to resolve issue"}) @@ -127,12 +129,12 @@ func (h *ProcessingIssuesHandler) DeleteProcessingIssue(c *echo.Context) error { return c.JSON(http.StatusBadRequest, map[string]string{"error": "Invalid issue ID"}) } - _, err = h.db.DeleteProcessingIssue(c.Request().Context(), issueID) + _, err = h.db.DeleteProcessingIssue(c.Request().Context(), pgtype.UUID{Bytes: issueID, Valid: true}) if err != nil { return c.JSON(http.StatusInternalServerError, map[string]string{"error": "Failed to delete issue"}) } - return c.JSON(http.StatusOK, map[string]interface{}{ + return c.JSON(http.StatusOK, map[string]any{ "success": true, "message": "Issue deleted", })