Fix some unhandler axios errors
This commit is contained in:
parent
68f2450c93
commit
76f6c64708
|
@ -362,25 +362,25 @@ const store: Module<State, RootState> = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
fetchUnreadNotifications ({ commit }) {
|
async fetchUnreadNotifications ({ commit }) {
|
||||||
axios.get('federation/inbox/', { params: { is_read: false, page_size: 1 } }).then((response) => {
|
const response = await axios.get('federation/inbox/', { params: { is_read: false, page_size: 1 } })
|
||||||
|
.catch(() => ({ data: { count: 0 } }))
|
||||||
commit('notifications', { type: 'inbox', count: response.data.count })
|
commit('notifications', { type: 'inbox', count: response.data.count })
|
||||||
})
|
|
||||||
},
|
},
|
||||||
fetchPendingReviewEdits ({ commit }) {
|
async fetchPendingReviewEdits ({ commit }) {
|
||||||
axios.get('mutations/', { params: { is_approved: 'null', page_size: 1 } }).then((response) => {
|
const response = await axios.get('mutations/', { params: { is_approved: 'null', page_size: 1 } })
|
||||||
|
.catch(() => ({ data: { count: 0 } }))
|
||||||
commit('notifications', { type: 'pendingReviewEdits', count: response.data.count })
|
commit('notifications', { type: 'pendingReviewEdits', count: response.data.count })
|
||||||
})
|
|
||||||
},
|
},
|
||||||
fetchPendingReviewReports ({ commit }) {
|
async fetchPendingReviewReports ({ commit }) {
|
||||||
axios.get('manage/moderation/reports/', { params: { is_handled: 'false', page_size: 1 } }).then((response) => {
|
const response = await axios.get('manage/moderation/reports/', { params: { is_handled: 'false', page_size: 1 } })
|
||||||
|
.catch(() => ({ data: { count: 0 } }))
|
||||||
commit('notifications', { type: 'pendingReviewReports', count: response.data.count })
|
commit('notifications', { type: 'pendingReviewReports', count: response.data.count })
|
||||||
})
|
|
||||||
},
|
},
|
||||||
fetchPendingReviewRequests ({ commit }) {
|
async fetchPendingReviewRequests ({ commit }) {
|
||||||
axios.get('manage/moderation/requests/', { params: { status: 'pending', page_size: 1 } }).then((response) => {
|
const response = await axios.get('manage/moderation/requests/', { params: { status: 'pending', page_size: 1 } })
|
||||||
|
.catch(() => ({ data: { count: 0 } }))
|
||||||
commit('notifications', { type: 'pendingReviewRequests', count: response.data.count })
|
commit('notifications', { type: 'pendingReviewRequests', count: response.data.count })
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async currentLanguage ({ commit, rootState }, value) {
|
async currentLanguage ({ commit, rootState }, value) {
|
||||||
|
|
Loading…
Reference in New Issue