Frozen error display

This commit is contained in:
Ludovic Stephan 2021-02-24 00:26:04 +01:00
parent 1e44550e12
commit 63738e8e02
3 changed files with 20 additions and 15 deletions

View file

@ -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

View file

@ -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
// -----

View file

@ -121,6 +121,9 @@ $(document).ready(function () {
case 403:
requestAuth(data, performTransfers);
break;
case 400:
displayErrors(getErrorsHtml(data));
break;
}
});
}