vikunja-frontend/src/services/notification.ts

22 lines
570 B
TypeScript
Raw Permalink Normal View History

import AbstractService from '@/services/abstractService'
2022-09-06 09:36:01 +00:00
import NotificationModel from '@/models/notification'
import type {INotification} from '@/modelTypes/INotification'
2022-07-21 16:56:31 +00:00
export default class NotificationService extends AbstractService<INotification> {
constructor() {
super({
getAll: '/notifications',
update: '/notifications/{id}',
})
}
modelFactory(data) {
return new NotificationModel(data)
}
beforeUpdate(model) {
model.created = new Date(model.created).toISOString()
model.readAt = new Date(model.readAt).toISOString()
return model
}
}