Catch server errors in edit task form
parent
bfa5ce2f35
commit
771ed5fc25
|
@ -138,15 +138,26 @@ TaskDirective = ($tgrepo, $log, $location, $confirm) ->
|
||||||
if not form.validate()
|
if not form.validate()
|
||||||
return
|
return
|
||||||
|
|
||||||
$tgrepo.save($scope.task).then ->
|
onSuccess = ->
|
||||||
$confirm.notify("success")
|
$confirm.notify("success")
|
||||||
$location.path("/project/#{$scope.project.slug}/tasks/#{$scope.task.ref}")
|
$location.path("/project/#{$scope.project.slug}/tasks/#{$scope.task.ref}")
|
||||||
|
|
||||||
|
onError = ->
|
||||||
|
$confirm.notify("error")
|
||||||
|
|
||||||
|
$tgrepo.save($scope.task).then(onSuccess, onError)
|
||||||
|
|
||||||
$el.on "click", ".add-comment a.button-green", (event) ->
|
$el.on "click", ".add-comment a.button-green", (event) ->
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
$tgrepo.save($scope.task).then ->
|
|
||||||
|
onSuccess = ->
|
||||||
$ctrl.loadHistory()
|
$ctrl.loadHistory()
|
||||||
|
|
||||||
|
onError = ->
|
||||||
|
$confirm.notify("error")
|
||||||
|
|
||||||
|
$tgrepo.save($scope.task).then(onSuccess, onError)
|
||||||
|
|
||||||
$el.on "focus", ".add-comment textarea", (event) ->
|
$el.on "focus", ".add-comment textarea", (event) ->
|
||||||
$(this).addClass('active')
|
$(this).addClass('active')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue