cac8b09263
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
34 lines
No EOL
721 B
JavaScript
34 lines
No EOL
721 B
JavaScript
import AbstractService from './abstractService'
|
|
import LabelModel from '../models/label'
|
|
import {formatISO} from 'date-fns'
|
|
|
|
export default class LabelService extends AbstractService {
|
|
constructor() {
|
|
super({
|
|
create: '/labels',
|
|
getAll: '/labels',
|
|
get: '/labels/{id}',
|
|
update: '/labels/{id}',
|
|
delete: '/labels/{id}',
|
|
})
|
|
}
|
|
|
|
processModel(label) {
|
|
label.created = formatISO(new Date(label.created))
|
|
label.updated = formatISO(new Date(label.updated))
|
|
label.hexColor = label.hexColor.substring(1, 7)
|
|
return label
|
|
}
|
|
|
|
modelFactory(data) {
|
|
return new LabelModel(data)
|
|
}
|
|
|
|
beforeUpdate(label) {
|
|
return this.processModel(label)
|
|
}
|
|
|
|
beforeCreate(label) {
|
|
return this.processModel(label)
|
|
}
|
|
} |