Refactor customer form and service for company ID validation.
This commit is contained in:
@@ -133,6 +133,9 @@ func (h *Handler) UpdateCustomer(c echo.Context) error {
|
||||
err.Error() == "company with this tax ID already exists" {
|
||||
return response.Conflict(c, err.Error())
|
||||
}
|
||||
if strings.HasPrefix(err.Error(), "invalid company ID") {
|
||||
return response.BadRequest(c, err.Error(), err.Error())
|
||||
}
|
||||
return response.InternalServerError(c, "Failed to update customer")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user