mirror of
https://github.com/ArenMg/aren.git
synced 2024-11-22 08:30:51 +00:00
edit agenda
This commit is contained in:
parent
cd17fd7f78
commit
485feeae3a
1 changed files with 26 additions and 12 deletions
|
@ -228,29 +228,43 @@ module.exports = {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
modifyAgenda: function () {
|
modifyAgenda: async function () {
|
||||||
new BrowserNotification("En cours de construction ....", {
|
try {
|
||||||
body: "Modification de l'agenda",
|
let success = await axios({
|
||||||
});
|
method: "put",
|
||||||
|
url: `${baseUrl}/ws/agenda/calendars/${this.$route.query.id}`,
|
||||||
|
data: this.editionProgram,
|
||||||
|
});
|
||||||
|
console.log(success)
|
||||||
|
swal("Succès!", "L'agenda a été modifié", "success").then((value) => {
|
||||||
|
this.program = {...this.editionProgram}
|
||||||
|
this.isEditMode = false;
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
swal("Erreur", `Une erreur s'est produite`, "error");
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
deleteCurrentAgenda: function () {
|
deleteCurrentAgenda: function () {
|
||||||
try {
|
try {
|
||||||
swal({
|
swal({
|
||||||
title: "Êtes-vous sûr?",
|
title: "Êtes-vous sûr?",
|
||||||
text:
|
text: "L'agenda sera supprimé",
|
||||||
"L'agenda sera supprimé",
|
|
||||||
icon: "warning",
|
icon: "warning",
|
||||||
buttons: ["Annuler", true],
|
buttons: ["Annuler", true],
|
||||||
dangerMode: true,
|
dangerMode: true,
|
||||||
}).then( async (willDelete) => {
|
}).then(async (willDelete) => {
|
||||||
if (willDelete) {
|
if (willDelete) {
|
||||||
let _ = await axios.delete(`${baseUrl}/ws/agenda/calendars/${this.$route.query.id}`);
|
let _ = await axios.delete(
|
||||||
swal("Succès!", "L'agenda a été supprimé", "success").then((value) => {
|
`${baseUrl}/ws/agenda/calendars/${this.$route.query.id}`
|
||||||
location.href = baseUrl;
|
);
|
||||||
});
|
swal("Succès!", "L'agenda a été supprimé", "success").then(
|
||||||
|
(value) => {
|
||||||
|
location.href = baseUrl;
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
swal("Erreur!", `${error}`, "error");
|
swal("Erreur!", `${error}`, "error");
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|
Loading…
Reference in a new issue