readd event confirmation in admin
This commit is contained in:
@@ -7,15 +7,14 @@
|
|||||||
:items='unconfirmedEvents'
|
:items='unconfirmedEvents'
|
||||||
:headers='headers')
|
:headers='headers')
|
||||||
template(v-slot:item.actions='{ item }')
|
template(v-slot:item.actions='{ item }')
|
||||||
v-btn(text small @click.stop='toggle(item)'
|
v-btn(text small @click='confirm(item)' color='success') {{$t('common.confirm')}}
|
||||||
:color='item.visible?"warning":"success"') {{item.visible?$t('common.disable'):$t('common.enable')}}
|
v-btn(text small :to='`/event/${item.id}`' color='success') {{$t('common.preview')}}
|
||||||
v-btn(text small @click='edit(item)') {{$t('common.edit')}}
|
v-btn(text small :to='`/add/${item.id}`' color='warning') {{$t('common.edit')}}
|
||||||
v-btn(text small @click='remove(item)'
|
v-btn(text small @click='remove(item)'
|
||||||
color='error') {{$t('common.delete')}}
|
color='error') {{$t('common.delete')}}
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import cloneDeep from 'lodash/cloneDeep'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -36,12 +35,11 @@ export default {
|
|||||||
edit (event) {
|
edit (event) {
|
||||||
this.$router.push(`/add/${event.id}`)
|
this.$router.push(`/add/${event.id}`)
|
||||||
},
|
},
|
||||||
async toggle (event) {
|
async confirm (event) {
|
||||||
try {
|
try {
|
||||||
event.is_visible = !event.is_visible
|
await this.$axios.$put(`/event/confirm/${event.id}`)
|
||||||
await this.$axios.$put(`/event/${event.id}`, event)
|
this.$emit('confirmed', event.id)
|
||||||
this.events = this.events.map(a => a.id === event.id ? event : a)
|
this.$root.$message('event.confirmed')
|
||||||
this.setevents(cloneDeep(this.events.filter(a => a.visible)))
|
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
},
|
},
|
||||||
async remove (event) {
|
async remove (event) {
|
||||||
|
|||||||
Reference in New Issue
Block a user