mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-13 04:00:21 +00:00
When a registering an enterprise with a non-unique name, display an error message.
This commit is contained in:
@@ -26,7 +26,11 @@ Darkswarm.factory "EnterpriseRegistrationService", ($http, RegistrationService,
|
||||
RegistrationService.select('about')
|
||||
).error((data) =>
|
||||
Loading.clear()
|
||||
alert('Failed to create your enterprise.\nPlease ensure all fields are completely filled out.')
|
||||
if data?.errors?
|
||||
errors = ("#{k.capitalize()} #{v[0]}" for k, v of data.errors when v.length > 0)
|
||||
alert "Failed to create your enterprise.\n" + errors.join('\n')
|
||||
else
|
||||
alert('Failed to create your enterprise.\nPlease ensure all fields are completely filled out.')
|
||||
)
|
||||
# RegistrationService.select('about')
|
||||
|
||||
|
||||
2
app/assets/javascripts/darkswarm/util.js.coffee
Normal file
2
app/assets/javascripts/darkswarm/util.js.coffee
Normal file
@@ -0,0 +1,2 @@
|
||||
String.prototype.capitalize = ->
|
||||
this.charAt(0).toUpperCase() + this.slice(1)
|
||||
Reference in New Issue
Block a user