From 0b724c58105b7d133c8a590ed31603ee581e48b0 Mon Sep 17 00:00:00 2001 From: Kosmatoff Date: Wed, 20 Dec 2023 15:08:33 +0300 Subject: [PATCH] add new status --- internal/microservices/user/delivery/http/handlers.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/microservices/user/delivery/http/handlers.go b/internal/microservices/user/delivery/http/handlers.go index fbe7e98..4a9367d 100644 --- a/internal/microservices/user/delivery/http/handlers.go +++ b/internal/microservices/user/delivery/http/handlers.go @@ -380,6 +380,7 @@ func (h *Handler) UpdatePhoto(w http.ResponseWriter, r *http.Request) { // need // @Failure 400 {object} ResponseError "Client error" // @Failure 401 {object} ResponseError "Unauthorized user" // @Failure 403 {object} ResponseError "Forbidden user" +// @Failure 404 {object} ResponseError "No user found with this login" // @Failure 500 {object} ResponseError "Server error" // @Router /api/user/addUserInAccount [post] func (h *Handler) AddUserInAccount(w http.ResponseWriter, r *http.Request) { @@ -400,7 +401,7 @@ func (h *Handler) AddUserInAccount(w http.ResponseWriter, r *http.Request) { if err := h.userService.AddUserInAccount(r.Context(), accountInput, user.ID); err != nil { var errNoSuchUser *models.NoSuchUserInLogin if errors.As(err, &errNoSuchUser) { - commonHttp.ErrorResponse(w, http.StatusBadRequest, err, transfer_models.UserNotFoundLogin, h.logger) + commonHttp.ErrorResponse(w, http.StatusNotFound, err, transfer_models.UserNotFoundLogin, h.logger) return }