aboutsummaryrefslogtreecommitdiff
path: root/resources/vue/components/courseware/tasks/TaskGroupsDeleteDialog.vue
blob: b1a151d8d96dc2af0f7ab102b23579deb5ded01d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<template>
    <studip-dialog
        :title="$gettext('Aufgabe löschen')"
        :question="$gettext('Möchten Sie die Aufgabe wirklich löschen?')"
        height="200"
        @close="onClose"
        @confirm="onConfirm"
    >
    </studip-dialog>
</template>

<script>
import { mapActions } from 'vuex';

export default {
    props: ['taskGroup'],
    methods: {
        ...mapActions({
            deleteTaskGroup: 'courseware-task-groups/delete',
            setShowTaskGroupsDeleteDialog: 'tasks/setShowTaskGroupsDeleteDialog'
        }),
        onClose() {
            this.setShowTaskGroupsDeleteDialog(false);
        },
        onConfirm() {
            this.deleteTaskGroup(this.taskGroup).then(() => {
                this.onClose();
                this.$router.push({ name: 'task-groups-index' });
            });
        },
    },
};
</script>