mirror of
https://akkoma.dev/AkkomaGang/akkoma-fe.git
synced 2024-11-13 20:14:42 +00:00
add fetchStatus action
This commit is contained in:
parent
e00cf288f5
commit
f969e9ab3d
2 changed files with 5 additions and 4 deletions
|
@ -25,10 +25,7 @@ const StatusPopover = {
|
||||||
methods: {
|
methods: {
|
||||||
enter () {
|
enter () {
|
||||||
if (!this.status) {
|
if (!this.status) {
|
||||||
this.$store.state.api.backendInteractor.fetchStatus({ id: this.statusId })
|
this.$store.dispatch('fetchStatus', this.statusId)
|
||||||
.then((status) => {
|
|
||||||
this.$store.dispatch('addNewStatuses', { statuses: [status] })
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -537,6 +537,10 @@ const statuses = {
|
||||||
setNotificationsSilence ({ rootState, commit }, { value }) {
|
setNotificationsSilence ({ rootState, commit }, { value }) {
|
||||||
commit('setNotificationsSilence', { value })
|
commit('setNotificationsSilence', { value })
|
||||||
},
|
},
|
||||||
|
fetchStatus ({ rootState, dispatch }, id) {
|
||||||
|
rootState.api.backendInteractor.fetchStatus({ id })
|
||||||
|
.then((status) => dispatch('addNewStatuses', { statuses: [status] }))
|
||||||
|
},
|
||||||
deleteStatus ({ rootState, commit }, status) {
|
deleteStatus ({ rootState, commit }, status) {
|
||||||
commit('setDeleted', { status })
|
commit('setDeleted', { status })
|
||||||
apiService.deleteStatus({ id: status.id, credentials: rootState.users.currentUser.credentials })
|
apiService.deleteStatus({ id: status.id, credentials: rootState.users.currentUser.credentials })
|
||||||
|
|
Loading…
Reference in a new issue