Add notifications overview (#414)
Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/414 Co-authored-by: konrad <konrad@kola-entertainments.de> Co-committed-by: konrad <konrad@kola-entertainments.de>
This commit is contained in:
parent
971d3cc358
commit
c076298cf0
11 changed files with 385 additions and 17 deletions
22
src/services/notification.js
Normal file
22
src/services/notification.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import AbstractService from '@/services/abstractService'
|
||||
import {formatISO} from 'date-fns'
|
||||
import NotificationModel from '@/models/notification'
|
||||
|
||||
export default class NotificationService extends AbstractService {
|
||||
constructor() {
|
||||
super({
|
||||
getAll: '/notifications',
|
||||
update: '/notifications/{id}',
|
||||
})
|
||||
}
|
||||
|
||||
modelFactory(data) {
|
||||
return new NotificationModel(data)
|
||||
}
|
||||
|
||||
beforeUpdate(model) {
|
||||
model.created = formatISO(new Date(model.created))
|
||||
model.readAt = formatISO(new Date(model.readAt))
|
||||
return model
|
||||
}
|
||||
}
|
||||
Reference in a new issue