feat(Delegate): add support of organization deletion
This commit is contained in:
parent
319a2e35bb
commit
48d341bd43
1 changed files with 57 additions and 1 deletions
|
@ -35,6 +35,9 @@
|
|||
<v-list-item @click="goToPage()">
|
||||
<v-list-item-title>Ouvrir la page publique</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item @click="openDestroyModal()">
|
||||
<v-list-item-title>Supprimer votre association</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item @click="logout()">
|
||||
<v-list-item-title>Se déconnecter</v-list-item-title>
|
||||
</v-list-item>
|
||||
|
@ -210,6 +213,35 @@
|
|||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="destroyModal" max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
Êtes vous sur de vouloir supprimer votre association ?
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<p>
|
||||
<b>Attention, ceci est une action pottentiellement dangereuse !</b>
|
||||
</p>
|
||||
<p>
|
||||
La suppression de votre association entraine une supression <b>DEFINITIVE</b> de manière <b>IMMEDIATE</b> de toute les données associés à votre association (textes, images, vidéos...).
|
||||
</p>
|
||||
<p>
|
||||
Cette action est <b>IRREVERSIBLE</b>.
|
||||
</p>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<div style="display:flex; justify-content:space-between; flex-wrap: wrap; width: 100%">
|
||||
<v-btn color="primary" text @click="destroyModal = false">Fermer</v-btn>
|
||||
<v-btn
|
||||
:loading="destroyLoading"
|
||||
color="error" text
|
||||
@click="destroy">
|
||||
je comprends, supprimer
|
||||
</v-btn>
|
||||
</div>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<Preview
|
||||
ref="preview"
|
||||
:enabled="previewModal"
|
||||
|
@ -241,7 +273,9 @@ export default {
|
|||
askingApprovalLoading: false,
|
||||
rejectionDetailsModal: false,
|
||||
showPassword: false,
|
||||
previewModal: false
|
||||
previewModal: false,
|
||||
destroyModal: false,
|
||||
destroyLoading: false
|
||||
}),
|
||||
created () {
|
||||
this.init()
|
||||
|
@ -469,6 +503,28 @@ export default {
|
|||
text: "Impossible de soumettre l'association"
|
||||
})
|
||||
})
|
||||
},
|
||||
openDestroyModal () {
|
||||
this.destroyModal = true
|
||||
},
|
||||
destroy () {
|
||||
this.destroyLoading = true
|
||||
this.$apitator.delete('/delegate/', { withAuth: true }).then(() => {
|
||||
this.destroyModal = false
|
||||
this.destroyLoading = false
|
||||
this.$store.commit('ADD_ALERT', {
|
||||
color: 'success',
|
||||
text: "Votre association vient d'être supprimé, bonne continuation!"
|
||||
})
|
||||
this.logout()
|
||||
}).catch(err => {
|
||||
console.error(err)
|
||||
this.destroyLoading = false
|
||||
this.$store.commit('ADD_ALERT', {
|
||||
color: 'error',
|
||||
text: "Impossible de supprimer l'association"
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue