fix create user dialog in admin
This commit is contained in:
parent
7888a8f360
commit
b925938397
2 changed files with 12 additions and 7 deletions
|
@ -91,14 +91,16 @@ export default {
|
||||||
if (!this.$refs.user_form.validate()) { return }
|
if (!this.$refs.user_form.validate()) { return }
|
||||||
try {
|
try {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
const user = await this.$axios.$post('/user', this.new_user)
|
await this.$axios.$post('/user', this.new_user)
|
||||||
this.new_user = { email: '', is_admin: false }
|
this.new_user = { email: '', is_admin: false }
|
||||||
|
|
||||||
this.$root.$message('admin.user_create_ok', { color: 'success' })
|
this.$root.$message('admin.user_create_ok', { color: 'success' })
|
||||||
this.users_.push(user)
|
this.$emit('update')
|
||||||
|
this.loading = false
|
||||||
|
this.newUserDialog = false
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const err = get(e, 'response.data.errors[0].message', e)
|
const err = get(e, 'response.data.errors[0].message', e)
|
||||||
this.$root.$message(this.$t(err), { color: 'error' })
|
this.$root.$message(this.$t(err), { color: 'error' })
|
||||||
|
this.loading = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
v-tab
|
v-tab
|
||||||
v-badge(:value='!!unconfirmedUsers.length' :content='unconfirmedUsers.length') {{$t('common.users')}}
|
v-badge(:value='!!unconfirmedUsers.length' :content='unconfirmedUsers.length') {{$t('common.users')}}
|
||||||
v-tab-item
|
v-tab-item
|
||||||
Users(:users='users')
|
Users(:users='users' @update='updateUsers')
|
||||||
|
|
||||||
//- PLACES
|
//- PLACES
|
||||||
v-tab {{$t('common.places')}}
|
v-tab {{$t('common.places')}}
|
||||||
|
@ -79,6 +79,9 @@ export default {
|
||||||
selectedTab: 0
|
selectedTab: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
head () {
|
||||||
|
return { title: `${this.settings.title} - ${this.$t('common.admin')}` }
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['settings']),
|
...mapState(['settings']),
|
||||||
unconfirmedUsers () {
|
unconfirmedUsers () {
|
||||||
|
@ -86,6 +89,9 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async updateUsers () {
|
||||||
|
this.users = await this.$axios.$get('/users')
|
||||||
|
},
|
||||||
preview (id) {
|
preview (id) {
|
||||||
this.$router.push(`/event/${id}`)
|
this.$router.push(`/event/${id}`)
|
||||||
},
|
},
|
||||||
|
@ -96,9 +102,6 @@ export default {
|
||||||
this.$root.$message('event.confirmed', { color: 'succes' })
|
this.$root.$message('event.confirmed', { color: 'succes' })
|
||||||
this.unconfirmedEvents = this.unconfirmedEvents.filter(e => e.id !== id)
|
this.unconfirmedEvents = this.unconfirmedEvents.filter(e => e.id !== id)
|
||||||
}
|
}
|
||||||
},
|
|
||||||
head () {
|
|
||||||
return { title: `${this.settings.title} - ${this.$t('common.admin')}` }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue