Skip to content

Commit

Permalink
fix statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
JolyBI3ll committed Dec 21, 2024
1 parent dd8c859 commit 49dfb3e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/ads/controller/ads_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ func (h *AdHandler) handleError(w http.ResponseWriter, err error, requestID stri
Error: err.Error(),
}
switch err.Error() {
case "ad not found", "ad date not found", "image not found", "error fetching all places":
case "ad not found", "ad date not found", "image not found", "error fetching all places", "error fetching places":
statusCode = http.StatusNotFound
case "ad already exists", "roomsNumber out of range", "not owner of ad":
statusCode = http.StatusConflict
Expand Down
2 changes: 1 addition & 1 deletion internal/cities/controller/cities_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (h *CityHandler) handleError(w http.ResponseWriter, err error, requestID st
statusCode = http.StatusBadRequest
case "error fetching all cities",
"error fetching city":
statusCode = http.StatusInternalServerError
statusCode = http.StatusNotFound
default:
statusCode = http.StatusInternalServerError
}
Expand Down

0 comments on commit 49dfb3e

Please sign in to comment.