forked from DGNum/gestioCOF
Frozen error display
This commit is contained in:
parent
1e44550e12
commit
63738e8e02
3 changed files with 20 additions and 15 deletions
|
@ -150,6 +150,12 @@ function getErrorsHtml(data) {
|
|||
content += '<li>Opération invalide sur le compte ' + data['errors']['account'] + '</li>';
|
||||
content += '</ul>';
|
||||
}
|
||||
if ('frozen' in data['errors']) {
|
||||
content += 'Général';
|
||||
content += '<ul>';
|
||||
content += '<li>Les comptes suivants sont gelés : ' + data['errors']['frozen'].join(", ") + '</li>';
|
||||
content += '</ul>';
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
|
@ -206,6 +212,17 @@ function requestAuth(data, callback, focus_next = null) {
|
|||
});
|
||||
}
|
||||
|
||||
function displayErrors(html) {
|
||||
$.alert({
|
||||
title: 'Erreurs',
|
||||
content: html,
|
||||
backgroundDismiss: true,
|
||||
animation: 'top',
|
||||
closeAnimation: 'bottom',
|
||||
keyboardEnabled: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Setup jquery-confirm
|
||||
|
|
|
@ -340,21 +340,6 @@ $(document).ready(function() {
|
|||
$('#id_comment').val('');
|
||||
}
|
||||
|
||||
// -----
|
||||
// Errors ajax
|
||||
// -----
|
||||
|
||||
function displayErrors(html) {
|
||||
$.alert({
|
||||
title: 'Erreurs',
|
||||
content: html,
|
||||
backgroundDismiss: true,
|
||||
animation: 'top',
|
||||
closeAnimation: 'bottom',
|
||||
keyboardEnabled: true,
|
||||
});
|
||||
}
|
||||
|
||||
// -----
|
||||
// Perform operations
|
||||
// -----
|
||||
|
|
|
@ -121,6 +121,9 @@ $(document).ready(function () {
|
|||
case 403:
|
||||
requestAuth(data, performTransfers);
|
||||
break;
|
||||
case 400:
|
||||
displayErrors(getErrorsHtml(data));
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue