refac: repository updates, image attachment and deletes report the domain not-found error for an unknown id, the same for articles, users and images, and the test fakes stop returning GORM errors
This commit is contained in:
1 parent
4278d96882
commit
6a2ca07b66
14 files changed
+553
-66
No files matched your search
@@ -127,6 +127,10 @@ func (h *Handler) DeleteArticle(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
if err := h.DeleteUseCase.DeleteArticle(uint32(id)); err != nil {
|
||||
if errors.Is(err, domain.ErrArticleNotFound) {
|
||||
http.Error(w, apperr.ArticleNotFoundErrorMessage, http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
http.Error(w, "Failed to delete article", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user