Ensure a callback function is provided

This commit is contained in:
Pau Perez
2017-09-29 16:10:11 +02:00
parent d3d4628e29
commit d8e3052575

View File

@@ -29,7 +29,6 @@ Darkswarm.factory "EnterpriseRegistrationService", ($http, RegistrationService,
@enterprise.id = data
EnterpriseImageService.configure(@enterprise)
RegistrationService.select('about')
callback.call()
).error((data) =>
Loading.clear()
if data?.errors?
@@ -37,9 +36,8 @@ Darkswarm.factory "EnterpriseRegistrationService", ($http, RegistrationService,
alert t('failed_to_create_enterprise') + "\n" + errors.join('\n')
else
alert(t('failed_to_create_enterprise_unknown'))
callback.call()
)
callback.call() if callback?
update: (step) =>
Loading.message = t('updating') + " " + @enterprise.name