feat(api): lab5 return 202 on upload and allow queued attachments in messages
This commit is contained in:
@@ -262,8 +262,8 @@ func (r *MessageRepo) validateAttachments(ctx context.Context, tx pgx.Tx, chatID
|
||||
if !ok || a.chatID != chatID {
|
||||
return &domain.NotFoundError{Entity: "attachment", ID: id}
|
||||
}
|
||||
if a.status != domain.AttachmentStatusReady {
|
||||
return &domain.ConflictError{Reason: "вложение " + id + " не готово"}
|
||||
if a.status == domain.AttachmentStatusFailed {
|
||||
return &domain.ConflictError{Reason: "вложение " + id + " в состоянии failed"}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user