vikunja-frontend/src/services/bucket.js
konrad cac8b09263 Add limits for kanban boards (#234)
Prevent dropping a task onto a bucket which has its limit reached

Fix closing the dropdown

Add notice to show the limit

Add input to change kanban bucket limit

Add menu item to save bucket limit

Fix parsing dates from the api

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/234
2020-09-04 20:01:02 +00:00

24 lines
No EOL
598 B
JavaScript

import AbstractService from './abstractService'
import BucketModel from '../models/bucket'
import TaskService from '@/services/task'
export default class BucketService extends AbstractService {
constructor() {
super({
getAll: '/lists/{listId}/buckets',
create: '/lists/{listId}/buckets',
update: '/lists/{listId}/buckets/{id}',
delete: '/lists/{listId}/buckets/{id}',
})
}
modelFactory(data) {
return new BucketModel(data)
}
beforeUpdate(model) {
const taskService = new TaskService()
model.tasks = model.tasks.map(t => taskService.processModel(t))
return model
}
}