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