summaryrefslogtreecommitdiffstats
path: root/webapp/src/components/RegistrationModuleDelete.vue
blob: 753c1995419f8ca5b510772b819a1c6e09a0b43b (plain) (blame)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<i18n>
{
  "en": {
    "title": "Delete this hook?"
  },
  "de": {
    "title": "Diesen Hook löschen?"
  }
}
</i18n>

<template>
  <v-card>
    <v-card-title class="dialog-title elevation-3">
      <div class="headline">{{ $t('title') }}</div>
    </v-card-title>
    <v-card-text>
      {{ dialog.info.type }} {{ dialog.info.name }}
    </v-card-text>
    <v-divider></v-divider>
    <v-card-actions>
      <v-spacer></v-spacer>
      <v-btn text="flat" @click="setDialog({ show: false })">{{ $t('cancel') }}</v-btn>
      <v-btn color="error" @click="deleteItems">{{ $t('delete') }}</v-btn>
    </v-card-actions>
  </v-card>
</template>

<script>
import { mapState } from 'vuex'

export default {
  name: 'RegistrationModuleDelete',
  data () {
    return {
    }
  },
  computed: {
    ...mapState('registration', ['dialog'])
  },
  methods: {
    setDialog (data) {
      this.$store.commit('registration/setDialog', data)
    },
    async deleteItems () {
      await this.$http.delete('/api/registration/hooks/' + this.dialog.info.id)
      this.$store.dispatch('registration/loadHooks')
      this.setDialog({ show: false })
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.dialog-title {
  z-index: 1;
}
.selected-list {
  padding: 30px;
}
</style>