add priority ids at outgoing letter

This commit is contained in:
efrilm
2025-10-13 03:33:20 +07:00
parent b81c0be3c4
commit cdc1244efc
5 changed files with 79 additions and 61 deletions
@@ -102,7 +102,17 @@ func (h *LetterOutgoingHandler) ListOutgoingLetters(c *gin.Context) {
req.Limit = 10
}
if ids := c.QueryArray("priority_ids[]"); len(ids) > 0 {
for _, s := range ids {
if id, err := uuid.Parse(s); err == nil {
req.PriorityIDs = append(req.PriorityIDs, id)
}
}
}
fmt.Printf("[DEBUG] request: %v\n", req)
fmt.Printf("[DEBUG] Raw query: %v\n", c.Request.URL.RawQuery)
fmt.Printf("[DEBUG] Parsed form: %v\n", c.Request.URL.Query())
resp, err := h.svc.ListOutgoingLetters(c.Request.Context(), &req)
if err != nil {