diff --git a/src/main/webapp/assets/js/views/agenda.vue b/src/main/webapp/assets/js/views/agenda.vue
index fbd0f0e..e25fe74 100644
--- a/src/main/webapp/assets/js/views/agenda.vue
+++ b/src/main/webapp/assets/js/views/agenda.vue
@@ -35,7 +35,7 @@
v-if="!isEditMode"
@click="
() => {
- deleteAgenda();
+ deleteCurrentAgenda();
}
"
>
@@ -93,7 +93,14 @@
-
@@ -226,12 +233,27 @@ module.exports = {
body: "Modification de l'agenda",
});
},
- deleteAgenda: async function () {
+ deleteCurrentAgenda: function () {
try {
- let _= await axios.delete(`${baseUrl}/ws/agenda/calendars/${this.$route.query.id}`);
- location.href = baseUrl;
+ swal({
+ title: "Êtes-vous sûr?",
+ text:
+ "L'agenda sera supprimé",
+ icon: "warning",
+ buttons: ["Annuler", true],
+ dangerMode: true,
+ }).then( async (willDelete) => {
+ if (willDelete) {
+ let _ = await axios.delete(`${baseUrl}/ws/agenda/calendars/${this.$route.query.id}`);
+ swal("Succès!", "L'agenda a été supprimé", "success").then((value) => {
+ location.href = baseUrl;
+ });
+ }
+ });
+
} catch (error) {
- console.log(error)
+ swal("Erreur!", `${error}`, "error");
+ console.log(error);
}
},
},
diff --git a/src/main/webapp/assets/js/views/agendas.vue b/src/main/webapp/assets/js/views/agendas.vue
index 06f1e6b..44cd8c6 100644
--- a/src/main/webapp/assets/js/views/agendas.vue
+++ b/src/main/webapp/assets/js/views/agendas.vue
@@ -47,19 +47,6 @@
-
-
Programme ajouté avec succès
-
{
- isInserted = false;
- }
- "
- >
- fermer
-
-
Une érreur est survenue (veuillez remplir tous les champs
@@ -191,11 +178,10 @@ module.exports = {
this.url = "";
this.selectedDate = new Date();
- this.isNotInserted = false;
- this.isInserted = true;
+ swal("Succès!", "L'agenda a été créé", "success");
+
} catch (error) {
- this.isNotInserted = true;
- this.isInserted = false;
+ swal("Erreur!", `${error}`, "error");
console.error(error);
}
},