1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-21 20:12:53 +00:00
bramw_baserow/web-frontend/components/group/CreateGroupModal.vue
2019-08-26 19:41:00 +02:00

49 lines
977 B
Vue

<template>
<Modal>
<h2 class="box-title">Create new group</h2>
<GroupForm ref="groupForm" @submitted="submitted">
<div class="actions">
<div class="align-right">
<button
class="button button-large"
:class="{ 'button-loading': loading }"
:disabled="loading"
>
Add group
</button>
</div>
</div>
</GroupForm>
</Modal>
</template>
<script>
import GroupForm from './GroupForm'
import modal from '@/mixins/modal'
export default {
name: 'CreateGroupModal',
components: { GroupForm },
mixins: [modal],
data() {
return {
loading: false
}
},
methods: {
submitted(values) {
this.loading = true
this.$store
.dispatch('group/create', values)
.then(() => {
this.loading = false
this.hide()
})
.catch(() => {
this.loading = false
})
}
}
}
</script>