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

25 lines
No EOL
538 B
TypeScript

import AbstractService from './abstractService'
import TeamModel from '../models/team'
import {formatISO} from 'date-fns'
export default class TeamService extends AbstractService {
constructor() {
super({
create: '/teams',
get: '/teams/{id}',
getAll: '/teams',
update: '/teams/{id}',
delete: '/teams/{id}',
})
}
processModel(model) {
model.created = formatISO(new Date(model.created))
model.updated = formatISO(new Date(model.updated))
return model
}
modelFactory(data) {
return new TeamModel(data)
}
}