e3483b1a5a
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>
25 lines
No EOL
564 B
TypeScript
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)
|
|
}
|
|
}
|
|
|