1
0

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
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)
})
},
},
}