vikunja-frontend/src/services/team.ts

25 lines
538 B
TypeScript
Raw Normal View History

import AbstractService from './abstractService'
import TeamModel from '../models/team'
2020-03-02 21:55:22 +01:00
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)
}
}