ask before remove resources
This commit is contained in:
@@ -68,7 +68,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { mapState, mapActions } from 'vuex'
|
import { mapState, mapActions } from 'vuex'
|
||||||
import { Message, MessageBox } from 'element-ui'
|
import { MessageBox } from 'element-ui'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Moderation',
|
name: 'Moderation',
|
||||||
@@ -142,15 +142,17 @@ export default {
|
|||||||
ap_user.blocked = !ap_user.blocked
|
ap_user.blocked = !ap_user.blocked
|
||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
},
|
},
|
||||||
async deleteResource (resource) {
|
deleteResource (resource) {
|
||||||
await MessageBox.confirm(this.$t('admin.delete_resource_confirm'),
|
MessageBox.confirm(this.$t('admin.delete_resource_confirm'),
|
||||||
this.$t('common.confirm'), {
|
this.$t('common.confirm'), {
|
||||||
confirmButtonText: this.$t('common.ok'),
|
confirmButtonText: this.$t('common.ok'),
|
||||||
cancelButtonText: this.$t('common.cancel'),
|
cancelButtonText: this.$t('common.cancel'),
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
}
|
||||||
await this.$axios.delete(`/resources/${resource.id}`)
|
).then(() => {
|
||||||
this.resources = this.resources.filter(r => r.id !== resource.id)
|
this.$axios.delete(`/resources/${resource.id}`)
|
||||||
|
this.resources = this.resources.filter(r => r.id !== resource.id)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
async toggleBlock (instance) {
|
async toggleBlock (instance) {
|
||||||
await this.$axios.post('/instances/toggle_block', { instance: instance.domain, blocked: !instance.blocked })
|
await this.$axios.post('/instances/toggle_block', { instance: instance.domain, blocked: !instance.blocked })
|
||||||
|
|||||||
Reference in New Issue
Block a user