2020-02-25 21:11:36 +01:00
|
|
|
import AbstractService from './abstractService'
|
|
|
|
import TaskCommentModel from '../models/taskComment'
|
2020-03-02 21:55:22 +01:00
|
|
|
import {formatISO} from 'date-fns'
|
2020-02-25 21:11:36 +01:00
|
|
|
|
|
|
|
export default class TaskCommentService extends AbstractService {
|
|
|
|
constructor() {
|
|
|
|
super({
|
|
|
|
create: '/tasks/{task_id}/comments',
|
|
|
|
getAll: '/tasks/{task_id}/comments',
|
|
|
|
get: '/tasks/{task_id}/comments/{id}',
|
|
|
|
update: '/tasks/{task_id}/comments/{id}',
|
|
|
|
delete: '/tasks/{task_id}/comments/{id}',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
processModel(model) {
|
2020-03-02 21:55:22 +01:00
|
|
|
model.created = formatISO(model.created)
|
|
|
|
model.updated = formatISO(model.updated)
|
2020-02-25 21:11:36 +01:00
|
|
|
return model
|
|
|
|
}
|
|
|
|
|
|
|
|
modelFactory(data) {
|
|
|
|
return new TaskCommentModel(data)
|
|
|
|
}
|
|
|
|
}
|