1
0

feat: ListKanban script setup (#2643)

Co-authored-by: Dominik Pschenitschni <mail@celement.de>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/2643
Co-authored-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
Co-committed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
This commit is contained in:
Dominik Pschenitschni
2022-11-07 17:23:11 +00:00
committed by konrad
parent 5186aeb086
commit d85abbd77a
7 changed files with 391 additions and 418 deletions

View File

@ -69,7 +69,7 @@ export const useKanbanStore = defineStore('kanban', {
getters: {
getBucketById(state) {
return (bucketId: IBucket['id']) => findById(state.buckets, bucketId)
return (bucketId: IBucket['id']): IBucket | undefined => findById(state.buckets, bucketId)
},
getTaskById(state) {
@ -265,11 +265,12 @@ export const useKanbanStore = defineStore('kanban', {
// Clear everything to prevent having old buckets in the list if loading the buckets from this list takes a few moments
this.setBuckets([])
params.per_page = TASKS_PER_BUCKET
const bucketService = new BucketService()
try {
const buckets = await bucketService.getAll({listId}, params)
const buckets = await bucketService.getAll({listId}, {
...params,
per_page: TASKS_PER_BUCKET,
})
this.setBuckets(buckets)
this.setListId(listId)
return buckets