Refactor customer form and service for company ID validation.

This commit is contained in:
Mazyar
2026-06-01 10:56:50 +03:30
parent cc6c0e1660
commit 64be9f4ef7
3 changed files with 88 additions and 45 deletions
+3
View File
@@ -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")
}