This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/src/models/linkShare.ts

29 lines
743 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
projectId = 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)
}
}