Creado popups de alerts para exito y error

This commit is contained in:
imnavajas
2023-07-23 21:39:52 +02:00
parent a0c6c617b0
commit b9f8da9558
4 changed files with 44 additions and 26 deletions

View File

@ -107,25 +107,16 @@ const lastColNr = $('#tableOfTarifasacabado').find("tr:first th").length - 1;
url: `/tarifas/tarifaacabado/delete/${dataId}`,
method: 'GET',
}).done((data, textStatus, jqXHR) => {
$('#confirm2delete').modal('toggle'),
Toast.fire({
icon: 'success',
title: data.msg ?? jqXHR.statusText,
});
$('#confirm2delete').modal('toggle');
theTable.clearPipeline();
theTable.row($(row)).invalidate().draw();
popSuccessAlert(data.msg ?? jqXHR.statusText);
}).fail((jqXHR, textStatus, errorThrown) => {
Toast.fire({
icon: 'error',
title: jqXHR.responseJSON.messages.error,
});
popErrorAlert(jqXHR.responseJSON.messages.error)
})
}
});
<?= $this->endSection() ?>