Adding more error control to sprint creation
parent
439939faf3
commit
6548576ad9
|
@ -172,10 +172,14 @@ CreateSprint = ($repo, $rs, $rootscope) ->
|
||||||
if not form.validate()
|
if not form.validate()
|
||||||
return
|
return
|
||||||
|
|
||||||
$repo.create("milestones", $scope.sprint).then (data) ->
|
promise = $repo.create("milestones", $scope.sprint)
|
||||||
|
promise.then (data) ->
|
||||||
$el.addClass("hidden")
|
$el.addClass("hidden")
|
||||||
$rootscope.$broadcast("sprintform:create:success", data)
|
$rootscope.$broadcast("sprintform:create:success", data)
|
||||||
|
|
||||||
|
promise.then null, (data) ->
|
||||||
|
form.setErrors(data)
|
||||||
|
|
||||||
$scope.$on "sprintform:create", ->
|
$scope.$on "sprintform:create", ->
|
||||||
$el.removeClass("hidden")
|
$el.removeClass("hidden")
|
||||||
$scope.sprint = {
|
$scope.sprint = {
|
||||||
|
|
Loading…
Reference in New Issue