vikunja-frontend/src/models/linkShare.ts

39 lines
898 B
TypeScript
Raw Normal View History

import AbstractModel, { type IAbstract } from './abstractModel'
2022-07-21 00:42:36 +02:00
import UserModel, { type IUser } from './user'
2022-08-13 15:26:57 +02:00
import {RIGHTS, type Right} from '@/constants/rights'
2019-09-09 19:55:43 +02:00
export interface ILinkShare extends IAbstract {
2022-06-23 03:22:21 +02:00
id: number
hash: string
right: Right
2022-07-21 00:42:36 +02:00
sharedBy: IUser
2022-06-23 03:22:21 +02:00
sharingType: number // FIXME: use correct numbers
listId: number
name: string
password: string
created: Date
updated: Date
2022-07-21 00:42:36 +02:00
}
export default class LinkShareModel extends AbstractModel 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
2019-09-09 19:55:43 +02:00
constructor(data: Partial<ILinkShare>) {
super()
this.assignData(data)
2019-09-09 19:55:43 +02:00
this.sharedBy = new UserModel(this.sharedBy)
this.created = new Date(this.created)
this.updated = new Date(this.updated)
}
2019-09-09 19:55:43 +02:00
}