|
|
@ -36,7 +36,7 @@ const sendRequest = (url, data) => { |
|
|
|
type: 'POST', |
|
|
|
data: data, |
|
|
|
success: function(data, textStatus, jqXHR) { |
|
|
|
resolve({ message: 'Fichier généré' }); |
|
|
|
resolve(data); |
|
|
|
}, |
|
|
|
error: function(jqXHR, textStatus, errorThrown) { |
|
|
|
reject( new Error('Erreur lors de la requête Ajax : ' + jqXHR.responseText) ); |
|
|
@ -98,6 +98,11 @@ const initSubmitForm = () => { |
|
|
|
toastr.success(response.message); |
|
|
|
$submitBtn.prop('disabled', false); |
|
|
|
$spinner.addClass('d-none'); |
|
|
|
if ( response.generated ) { |
|
|
|
$form__result.removeClass('d-none'); |
|
|
|
$form__result.find('a').attr('href', `/csv/${response.generated}`) |
|
|
|
$form__result.find('a').html(response.generated); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
toastr.error(error.message); |
|
|
@ -138,13 +143,6 @@ const initSocket = () => { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (eventName === 'parse.end' && data.generated) { |
|
|
|
const $form__result = $('#form__result'); |
|
|
|
$form__result.removeClass('d-none'); |
|
|
|
$form__result.find('a').attr('href', `/csv/${data.generated}`) |
|
|
|
$form__result.find('a').html(data.generated); |
|
|
|
} |
|
|
|
|
|
|
|
toastr.info(data.message); |
|
|
|
}); |
|
|
|
} |
|
|
|