diff --git a/internal/models/bankers.go b/internal/models/bankers.go index f0383677337e55b9b155185ea73724b259cfd6fd..7be006c25f30c9913a19708f514b83f0d5ecb5d9 100644 --- a/internal/models/bankers.go +++ b/internal/models/bankers.go @@ -119,12 +119,12 @@ func (d *DataHandler) postBankerAdmin(w http.ResponseWriter, r *http.Request, id // check userID is not already present in DB var client UserClient if err := d.db.Where(reqUserID, o.UserID).First(&client).Error; err == nil { - http.Error(w, "UserID is already bind to a Client", http.StatusNotFound) + http.Error(w, "UserID is already bind to a Client", http.StatusInternalServerError) return } var banker UserBanker if err := d.db.Where(reqUserID, o.UserID).First(&banker).Error; err == nil { - http.Error(w, "UserID is already bind to a Banker", http.StatusNotFound) + http.Error(w, "UserID is already bind to a Banker", http.StatusInternalServerError) return } d.db.Create(&o) diff --git a/internal/models/clients.go b/internal/models/clients.go index 55871c6b88c5af4e813125700d8b86c353286ad6..f8ebc1a1b3d1ad2dd9e718b2fdd5ed692737c8f8 100644 --- a/internal/models/clients.go +++ b/internal/models/clients.go @@ -139,12 +139,12 @@ func (d *DataHandler) postClientAdmin(w http.ResponseWriter, r *http.Request, id // check userID is not already present in DB var client UserClient if err := d.db.Where(reqUserID, o.UserID).First(&client).Error; err == nil { - http.Error(w, "UserID is already bind to a Client", http.StatusNotFound) + http.Error(w, "UserID is already bind to a Client", http.StatusInternalServerError) return } var banker UserBanker if err := d.db.Where(reqUserID, o.UserID).First(&banker).Error; err == nil { - http.Error(w, "UserID is already bind to a Banker", http.StatusNotFound) + http.Error(w, "UserID is already bind to a Banker", http.StatusInternalServerError) return } d.db.Create(&o)