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