Fetch banned objects after banning an url

This commit is contained in:
Angelina Filippova 2020-07-07 22:28:46 +03:00
parent cd689ac75c
commit 0b36c5bbb0
2 changed files with 5 additions and 1 deletions

View file

@ -32,13 +32,16 @@ const mediaProxyCache = {
commit('SET_PAGE', page)
commit('SET_LOADING', false)
},
async PurgeUrls({ commit, getters }, { urls, ban }) {
async PurgeUrls({ dispatch, getters, state }, { urls, ban }) {
await purgeUrls(urls, ban, getters.authHost, getters.token)
Message({
message: i18n.t('mediaProxyCache.evictedMessage'),
type: 'success',
duration: 5 * 1000
})
if (ban) {
dispatch('ListBannedUrls', state.currentPage)
}
},
async RemoveBannedUrls({ commit, getters }, urls) {
await removeBannedUrls(urls, getters.authHost, getters.token)

View file

@ -73,6 +73,7 @@ export default {
evictURL() {
const urls = typeof this.url === 'string' ? [this.url] : this.url
this.$store.dispatch('PurgeUrls', { urls, ban: this.ban })
this.url = ''
},
handleSelectionChange(value) {
this.$data.selectedUrls = value