mirror of
https://github.com/serty2005/rmser.git
synced 2026-02-04 19:02:33 -06:00
редактирование и удаление сопоставлений
список накладных с позициями
This commit is contained in:
@@ -132,3 +132,20 @@ func (h *OCRHandler) GetUnmatched(c *gin.Context) {
|
||||
}
|
||||
c.JSON(http.StatusOK, items)
|
||||
}
|
||||
|
||||
func (h *OCRHandler) DiscardUnmatched(c *gin.Context) {
|
||||
userID := c.MustGet("userID").(uuid.UUID)
|
||||
rawName := c.Query("raw_name")
|
||||
|
||||
if rawName == "" {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "raw_name is required"})
|
||||
return
|
||||
}
|
||||
|
||||
if err := h.service.DiscardUnmatched(userID, rawName); err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"status": "discarded"})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user