Merge branch 'tusooa/1244-report-delete-fail' into 'develop'

Display delete status errors

Closes #1244

See merge request pleroma/pleroma-fe!1769
This commit is contained in:
HJ 2023-04-11 21:26:16 +00:00
commit 9c376b3511
3 changed files with 16 additions and 4 deletions

View file

@ -615,9 +615,19 @@ const statuses = {
fetchStatusHistory ({ rootState, dispatch }, status) {
return apiService.fetchStatusHistory({ status })
},
deleteStatus ({ rootState, commit }, status) {
commit('setDeleted', { status })
deleteStatus ({ rootState, commit, dispatch }, status) {
apiService.deleteStatus({ id: status.id, credentials: rootState.users.currentUser.credentials })
.then((_) => {
commit('setDeleted', { status })
})
.catch((e) => {
dispatch('pushGlobalNotice', {
level: 'error',
messageKey: 'status.delete_error',
messageArgs: [e.message],
timeout: 5000
})
})
},
deleteStatusById ({ rootState, commit }, id) {
const status = rootState.statuses.allStatusesObject[id]