vikunja-frontend/src/services/linkShare.ts
2022-04-02 17:14:59 +02:00

24 lines
No EOL
591 B
TypeScript

import AbstractService from './abstractService'
import LinkShareModel from '../models/linkShare'
import {formatISO} from 'date-fns'
export default class ListService extends AbstractService {
constructor() {
super({
getAll: '/lists/{listId}/shares',
get: '/lists/{listId}/shares/{id}',
create: '/lists/{listId}/shares',
delete: '/lists/{listId}/shares/{id}',
})
}
processModel(model) {
model.created = formatISO(new Date(model.created))
model.updated = formatISO(new Date(model.updated))
return model
}
modelFactory(data) {
return new LinkShareModel(data)
}
}