mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-26 05:55:15 +00:00
Adding basic validation to reg process
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
Darkswarm.controller "RegistrationCtrl", ($scope, RegistrationService, EnterpriseRegistrationService, availableCountries) ->
|
||||
$scope.currentStep = RegistrationService.currentStep
|
||||
$scope.select = RegistrationService.select
|
||||
$scope.enterprise = EnterpriseRegistrationService.enterprise
|
||||
$scope.create = EnterpriseRegistrationService.create
|
||||
$scope.update = EnterpriseRegistrationService.update
|
||||
$scope.select = RegistrationService.select
|
||||
|
||||
$scope.steps = ['details','address','contact','about','images','social']
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
Darkswarm.controller "RegistrationFormCtrl", ($scope, RegistrationService, EnterpriseRegistrationService) ->
|
||||
$scope.submitted = false
|
||||
|
||||
$scope.create = (form) ->
|
||||
$scope.submitted = true
|
||||
if form.$valid
|
||||
EnterpriseRegistrationService.create()
|
||||
$scope.submitted = false
|
||||
|
||||
$scope.update = (nextStep, form) ->
|
||||
$scope.submitted = true
|
||||
if form.$valid
|
||||
EnterpriseRegistrationService.update(nextStep)
|
||||
$scope.submitted = false
|
||||
|
||||
$scope.select = (nextStep, form) ->
|
||||
$scope.submitted = true
|
||||
if form.$valid
|
||||
RegistrationService.select(nextStep)
|
||||
$scope.submitted = false
|
||||
Reference in New Issue
Block a user