vikunja-frontend/src/services/namespace.js

25 lines
564 B
JavaScript
Raw Normal View History

import AbstractService from './abstractService'
import NamespaceModel from '../models/namespace'
2020-03-02 21:55:22 +01:00
import {formatISO} from 'date-fns'
export default class NamespaceService extends AbstractService {
constructor() {
super({
create: '/namespaces',
get: '/namespaces/{id}',
getAll: '/namespaces',
update: '/namespaces/{id}',
delete: '/namespaces/{id}',
});
}
processModel(model) {
2020-03-02 21:55:22 +01:00
model.created = formatISO(model.created)
model.updated = formatISO(model.updated)
return model
}
modelFactory(data) {
return new NamespaceModel(data)
}
}