Commit list accounts state after difference in removed accounts is determined #82

Merged
floatingghost merged 2 commits from :commit-list-accounts-after-delete into develop 2022-08-01 10:11:40 +00:00
Showing only changes of commit 19ae21d7ab - Show all commits

View file

@ -57,12 +57,12 @@ const actions = {
commit('setList', { id, title })
},
setListAccounts ({ rootState, commit }, { id, accountIds }) {
commit('setListAccounts', { id, accountIds })
rootState.api.backendInteractor.addAccountsToList({ id, accountIds })
rootState.api.backendInteractor.removeAccountsFromList({
id,
accountIds: rootState.lists.allListsObject[id].accountIds.filter(id => !accountIds.includes(id))
})
commit('setListAccounts', { id, accountIds })
},
deleteList ({ rootState, commit }, { id }) {
rootState.api.backendInteractor.deleteList({ id })