vikunja-frontend/src/services/caldavToken.ts
Dominik Pschenitschni e3483b1a5a fix: rename caldavToken to ts (#1814)
Co-authored-by: Dominik Pschenitschni <mail@celement.de>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/1814
Reviewed-by: konrad <k@knt.li>
Co-authored-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
Co-committed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
2022-04-18 17:22:19 +00:00

25 lines
No EOL
564 B
TypeScript

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: Partial<CaldavTokenModel>) {
return {
...model,
created: formatISO(new Date(model.created)),
}
}
modelFactory(data) {
return new CaldavTokenModel(data)
}
}