vikunja-frontend/src/services/caldavToken.js

23 lines
529 B
JavaScript
Raw Normal View History

2021-12-12 18:28:14 +01:00
import {formatISO} from 'date-fns'
import CaldavTokenModel from '../models/caldavToken'
import AbstractService from './abstractService'
export default class CaldavTokenService extends AbstractService {
constructor() {
super({
getAll: '/user/settings/token/caldav',
create: '/user/settings/token/caldav',
delete: '/user/settings/token/caldav/{id}',
})
}
processModel(model) {
model.created = formatISO(new Date(model.created))
return model
}
modelFactory(data) {
return new CaldavTokenModel(data)
}
}