Skip to content
Snippets Groups Projects
Commit 14a46f77 authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Dispatch URL Search when removing and purging urls

parent b37f9142
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ const mediaProxyCache = {
loading: false,
mediaProxyEnabled: false,
pageSize: 50,
searchQuery: '',
totalUrlsCount: 0
},
mutations: {
......@@ -27,6 +28,9 @@ const mediaProxyCache = {
},
SET_PAGE: (state, page) => {
state.currentPage = page
},
SET_SEARCH_QUERY: (state, query) => {
state.searchQuery = query
}
},
actions: {
......@@ -69,13 +73,19 @@ const mediaProxyCache = {
type: 'success',
duration: 5 * 1000
})
if (ban) {
if (ban && state.searchQuery.length === 0) {
dispatch('ListBannedUrls', { page: state.currentPage })
} else if (ban) {
dispatch('SearchUrls', { query: state.searchQuery, page: state.currentPage })
}
},
async RemoveBannedUrls({ dispatch, getters, state }, urls) {
await removeBannedUrls(urls, getters.authHost, getters.token)
dispatch('ListBannedUrls', { page: state.currentPage })
if (state.searchQuery.length === 0) {
dispatch('ListBannedUrls', { page: state.currentPage })
} else {
dispatch('SearchUrls', { query: state.searchQuery, page: state.currentPage })
}
},
async SearchUrls({ commit, dispatch, getters, state }, { query, page }) {
if (query.length === 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment