1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

improved error message on machine reservation w/ stripe payment

This commit is contained in:
Sylvain 2016-11-29 09:15:30 +01:00
parent 70a369a2b9
commit 0c05b45d08

View File

@ -816,14 +816,19 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat
$uibModalInstance.close(reservation)
, (response)->
$scope.alerts = []
if response.status != 500
$scope.alerts.push
msg: response.data.card[0]
type: 'danger'
else
if response.status == 500
$scope.alerts.push
msg: response.statusText
type: 'danger'
else
if response.data.card and response.data.card.join('').length > 0
$scope.alerts.push
msg: response.data.card.join('. ')
type: 'danger'
else if response.data.payment and response.data.payment.join('').length > 0
$scope.alerts.push
msg: response.data.payment.join('. ')
type: 'danger'
$scope.attempting = false
]
.result['finally'](null).then (reservation)->