vikunja-frontend/src/models/linkShare.ts
Dominik Pschenitschni 1a11b43ca8 feat: improve models
2022-09-13 14:59:02 +00:00

29 lines
No EOL
740 B
TypeScript

import AbstractModel from './abstractModel'
import UserModel from './user'
import {RIGHTS, type Right} from '@/constants/rights'
import type {ILinkShare} from '@/modelTypes/ILinkShare'
import type {IUser} from '@/modelTypes/IUser'
export default class LinkShareModel extends AbstractModel<ILinkShare> implements ILinkShare {
id = 0
hash = ''
right: Right = RIGHTS.READ
sharedBy: IUser = UserModel
sharingType = 0 // FIXME: use correct numbers
listId = 0
name: ''
password: ''
created: Date = null
updated: Date = null
constructor(data: Partial<ILinkShare>) {
super()
this.assignData(data)
this.sharedBy = new UserModel(this.sharedBy)
this.created = new Date(this.created)
this.updated = new Date(this.updated)
}
}