Create list through store to make sure it is updated everywhere

This commit is contained in:
kolaente 2020-11-12 19:59:32 +01:00
parent 2d70c1aabd
commit 3677ffd585
Signed by untrusted user who does not match committer: konrad
GPG key ID: F40E70337AB24C9B
2 changed files with 17 additions and 5 deletions

View file

@ -52,5 +52,19 @@ export default {
return Promise.reject(e)
})
},
createList(ctx, list) {
const listService = new ListService()
return listService.create(list)
.then(r => {
r.namespaceId = list.namespaceId
ctx.commit('namespaces/addListToNamespace', r, {root: true})
ctx.commit('addList', r)
return Promise.resolve(r)
})
.catch(e => {
return Promise.reject(e)
})
},
},
}