mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 10:49:10 -04:00
Ajout de la BD OCOM
This commit is contained in:
39
public/js/ocom.js
vendored
Normal file
39
public/js/ocom.js
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
function deleteOCOM(id)
|
||||
{
|
||||
Swal.fire({
|
||||
title: 'Êtes vous certain ?',
|
||||
text: "Vous ne pourrez annuler cette action",
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Oui',
|
||||
cancelButtonText: 'Non'
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
let request = $.ajax({
|
||||
url: "/api/ocom/"+id,
|
||||
method: "DELETE",
|
||||
data: { api_token : api_token },
|
||||
dataType: "html"
|
||||
});
|
||||
request.done(function (msg) {
|
||||
Swal.fire(
|
||||
'Supprimé!',
|
||||
'Le fichier a été supprimé',
|
||||
'success'
|
||||
).then(() => {
|
||||
window.location.href = '/admin/ocom';
|
||||
});
|
||||
});
|
||||
request.fail(function (jqXHR, textStatus) {
|
||||
Swal.fire({
|
||||
type: 'error',
|
||||
title: 'Oops...',
|
||||
text: 'Le cours n\'a pas pus être supprimé',
|
||||
footer: '<small>'+textStatus+'</small>'
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user