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:
parent
70a369a2b9
commit
0c05b45d08
@ -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)->
|
||||
|
Loading…
x
Reference in New Issue
Block a user