ЛР 5 — БВТ2303 — Голиков — на 5 #69

Closed
Maximillan_Mercer wants to merge 46 commits from Maximillan_Mercer/mtusi2026lab5-fork:solution/BVT2303-Golikov into main
2 changed files with 3 additions and 3 deletions
Showing only changes of commit f4c6657a10 - Show all commits
@@ -52,7 +52,7 @@ func (h *AttachmentHandler) Upload(c *gin.Context) {
respondError(c, err) respondError(c, err)
return return
} }
c.JSON(http.StatusCreated, dto.AttachmentFromDomain(att)) c.JSON(http.StatusAccepted, dto.AttachmentFromDomain(att))
} }
func (h *AttachmentHandler) Get(c *gin.Context) { func (h *AttachmentHandler) Get(c *gin.Context) {
+2 -2
View File
@@ -262,8 +262,8 @@ func (r *MessageRepo) validateAttachments(ctx context.Context, tx pgx.Tx, chatID
if !ok || a.chatID != chatID { if !ok || a.chatID != chatID {
return &domain.NotFoundError{Entity: "attachment", ID: id} return &domain.NotFoundError{Entity: "attachment", ID: id}
} }
if a.status != domain.AttachmentStatusReady { if a.status == domain.AttachmentStatusFailed {
return &domain.ConflictError{Reason: "вложение " + id + " не готово"} return &domain.ConflictError{Reason: "вложение " + id + " в состоянии failed"}
} }
} }
return nil return nil