mirror of
https://github.com/ArenMg/aren.git
synced 2024-11-22 00:20:52 +00:00
implement comment delete
This commit is contained in:
parent
551b4fa3a0
commit
58e3dba66c
1 changed files with 13 additions and 10 deletions
|
@ -38,7 +38,9 @@
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
v-if="clipboard && ($root.user.is('ADMIN') || $root.user.is('MODO'))"
|
v-if="
|
||||||
|
clipboard && ($root.user.is('ADMIN') || $root.user.is('MODO'))
|
||||||
|
"
|
||||||
title="Exporter vers l'Influent"
|
title="Exporter vers l'Influent"
|
||||||
@click="shareComment()"
|
@click="shareComment()"
|
||||||
>
|
>
|
||||||
|
@ -48,7 +50,7 @@
|
||||||
<button
|
<button
|
||||||
v-if="$root.user.is('ADMIN') || $root.user.is('MODO')"
|
v-if="$root.user.is('ADMIN') || $root.user.is('MODO')"
|
||||||
title="Supprimer le commentaire"
|
title="Supprimer le commentaire"
|
||||||
@click="deleteComment()"
|
@click="deleteComment(comment.id)"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
class="copy-img"
|
class="copy-img"
|
||||||
|
@ -170,6 +172,8 @@
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
const getUrl = window.location;
|
||||||
|
let baseUrl = getUrl.protocol + "//" + getUrl.host;
|
||||||
module.exports = {
|
module.exports = {
|
||||||
props: [
|
props: [
|
||||||
"comment",
|
"comment",
|
||||||
|
@ -261,9 +265,6 @@ module.exports = {
|
||||||
.replace(/'/g, "'");
|
.replace(/'/g, "'");
|
||||||
},
|
},
|
||||||
copyToClipBoard(text) {
|
copyToClipBoard(text) {
|
||||||
const getUrl = window.location;
|
|
||||||
let baseUrl = getUrl.protocol + "//" + getUrl.host;
|
|
||||||
|
|
||||||
navigator.clipboard.writeText(`${baseUrl}${text}`).then(
|
navigator.clipboard.writeText(`${baseUrl}${text}`).then(
|
||||||
function () {
|
function () {
|
||||||
alert("lien copié dans le presse-papier");
|
alert("lien copié dans le presse-papier");
|
||||||
|
@ -273,7 +274,7 @@ module.exports = {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
deleteComment() {
|
deleteComment(idComment) {
|
||||||
try {
|
try {
|
||||||
swal({
|
swal({
|
||||||
title: "Êtes-vous sûr?",
|
title: "Êtes-vous sûr?",
|
||||||
|
@ -283,12 +284,14 @@ module.exports = {
|
||||||
dangerMode: true,
|
dangerMode: true,
|
||||||
}).then(async (willDelete) => {
|
}).then(async (willDelete) => {
|
||||||
if (willDelete) {
|
if (willDelete) {
|
||||||
// let _ = await axios.delete(
|
let _ = await axios.delete(
|
||||||
// `${baseUrl}/ws/themes/delete/${this.$route.query.id}`
|
`${baseUrl}/ws/comments/delete/${idComment}`
|
||||||
// );
|
);
|
||||||
|
console.log(idComment)
|
||||||
|
console.log(_)
|
||||||
swal("Succès!", "Le commentaire a été supprimé", "success").then(
|
swal("Succès!", "Le commentaire a été supprimé", "success").then(
|
||||||
(value) => {
|
(value) => {
|
||||||
// location.href = baseUrl;
|
location.reload();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue