stash
This commit is contained in:
parent
d5107a59e3
commit
e8811df1c4
3 changed files with 32 additions and 23 deletions
|
@ -22,6 +22,7 @@ const store = createStore({
|
|||
messageTemplates: [],
|
||||
messageTemplateVariables: [],
|
||||
shippingVouchers: [],
|
||||
userNotificationChannels: [],
|
||||
|
||||
lastEvent: '37C3',
|
||||
lastUsed: {},
|
||||
|
@ -532,7 +533,14 @@ const store = createStore({
|
|||
state.fetchedData.tickets = 0;
|
||||
await Promise.all([dispatch('loadTickets'), dispatch('fetchShippingVouchers')]);
|
||||
}
|
||||
}
|
||||
},
|
||||
async fetchUserNotificationChannels({commit, state}) {
|
||||
if (!state.user.token) return;
|
||||
const {data, success} = await http.get('/2/user_notification_channels/', state.user.token);
|
||||
if (data && success) {
|
||||
state.userNotificationChannels = data;
|
||||
}
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
persistentStatePlugin({ // TODO change remember to some kind of enable field
|
||||
|
|
|
@ -1,22 +1,9 @@
|
|||
<template>
|
||||
<Table
|
||||
:columns="['slug', 'name']"
|
||||
:items="events"
|
||||
:keyName="'slug'"
|
||||
>
|
||||
<template #actions="{ item }">
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-secondary" @click.stop="changeEvent(item)">
|
||||
<font-awesome-icon icon="archive"/>
|
||||
use
|
||||
</button>
|
||||
<button class="btn btn-danger" @click.stop="">
|
||||
<font-awesome-icon icon="trash"/>
|
||||
delete
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
</Table>
|
||||
<ul>
|
||||
<li v-for="channel in userNotificationChannels" :key="channel.id">
|
||||
{{ channel.name }}
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -26,8 +13,11 @@ import Table from '@/components/Table';
|
|||
export default {
|
||||
name: 'Notifications',
|
||||
components: {Table},
|
||||
computed: mapState(['events']),
|
||||
methods: mapActions(['changeEvent']),
|
||||
computed: mapState(['userNotificationChannels']),
|
||||
methods: mapActions(['fetchUserNotificationChannels']),
|
||||
mounted() {
|
||||
this.fetchUserNotificationChannels();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue