vikunja-frontend/src/services/userList.js
2020-03-02 21:55:22 +01:00

29 lines
No EOL
679 B
JavaScript

import AbstractService from './abstractService'
import UserListModel from '../models/userList'
import UserModel from '../models/user'
import {formatISO} from 'date-fns'
export default class UserListService extends AbstractService {
constructor() {
super({
create: '/lists/{listID}/users',
getAll: '/lists/{listID}/users',
update: '/lists/{listID}/users/{userID}',
delete: '/lists/{listID}/users/{userID}',
})
}
processModel(model) {
model.created = formatISO(model.created)
model.updated = formatISO(model.updated)
return model
}
modelFactory(data) {
return new UserListModel(data)
}
modelGetAllFactory(data) {
return new UserModel(data)
}
}