fix(api): org name taken error now returns HTTP status code 409, closes

This commit is contained in:
Torkel Ödegaard 2016-02-12 10:01:45 +01:00
parent f797b19825
commit 53f5cb6553

View File

@ -84,7 +84,7 @@ func CreateOrg(c *middleware.Context, cmd m.CreateOrgCommand) Response {
cmd.UserId = c.UserId cmd.UserId = c.UserId
if err := bus.Dispatch(&cmd); err != nil { if err := bus.Dispatch(&cmd); err != nil {
if err == m.ErrOrgNameTaken { if err == m.ErrOrgNameTaken {
return ApiError(400, "Organization name taken", err) return ApiError(409, "Organization name taken", err)
} }
return ApiError(500, "Failed to create organization", err) return ApiError(500, "Failed to create organization", err)
} }