mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Clarify credit error
This commit is contained in:
parent
43f38d9d84
commit
fceb82ea51
@ -263,13 +263,25 @@
|
||||
$('#saveButton').attr('disabled', false);
|
||||
canSubmitPayment = true;
|
||||
|
||||
var error = '';
|
||||
var error = '{{ trans('texts.error_refresh_page') }}';
|
||||
if (data) {
|
||||
var error = firstJSONError(data.responseJSON) || data.statusText;
|
||||
error = firstPaymentError(data.responseJSON);
|
||||
}
|
||||
swal({!! json_encode(trans('texts.error_refresh_page')) !!}, error);
|
||||
|
||||
swal({title: '{{ trans('texts.an_error_occurred') }}', text: error});
|
||||
}
|
||||
|
||||
function firstPaymentError(json) {
|
||||
json = json['errors'];
|
||||
for (var key in json) {
|
||||
if ( ! json.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
return json[key] + '';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function submitAction(action) {
|
||||
$('#action').val(action);
|
||||
$('.main-form').submit();
|
||||
|
Loading…
Reference in New Issue
Block a user