Catch server errors in edit US form
parent
771ed5fc25
commit
a1067ad503
|
@ -151,15 +151,26 @@ UsDirective = ($tgrepo, $log, $location, $confirm) ->
|
||||||
if not form.validate()
|
if not form.validate()
|
||||||
return
|
return
|
||||||
|
|
||||||
$tgrepo.save($scope.us).then ->
|
onSuccess = ->
|
||||||
$confirm.notify("success")
|
$confirm.notify("success")
|
||||||
$location.path("/project/#{$scope.project.slug}/us/#{$scope.us.ref}")
|
$location.path("/project/#{$scope.project.slug}/us/#{$scope.us.ref}")
|
||||||
|
|
||||||
|
onError = ->
|
||||||
|
$confirm.notify("error")
|
||||||
|
|
||||||
|
$tgrepo.save($scope.us).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.us).then ->
|
|
||||||
|
onSuccess = ->
|
||||||
$ctrl.loadHistory()
|
$ctrl.loadHistory()
|
||||||
|
|
||||||
|
onError = ->
|
||||||
|
$confirm.notify("error")
|
||||||
|
|
||||||
|
$tgrepo.save($scope.us).then(onSuccess, onError)
|
||||||
|
|
||||||
$el.on "click", ".us-activity-tabs li a", (event) ->
|
$el.on "click", ".us-activity-tabs li a", (event) ->
|
||||||
$el.find(".us-activity-tabs li a").toggleClass("active")
|
$el.find(".us-activity-tabs li a").toggleClass("active")
|
||||||
$el.find(".us-activity section").toggleClass("hidden")
|
$el.find(".us-activity section").toggleClass("hidden")
|
||||||
|
|
Loading…
Reference in New Issue