forked from vikunja/frontend
Dominik Pschenitschni
96f5f00c07
We used declare which is the wrong use-case for this. See: https://www.typescriptlang.org/docs/handbook/2/classes.html#--strictpropertyinitialization
35 lines
646 B
TypeScript
35 lines
646 B
TypeScript
import AbstractModel from './abstractModel'
|
|
import {RIGHTS, type Right} from '@/constants/rights'
|
|
import type { IUser } from './user'
|
|
|
|
export interface IUserShareBase extends AbstractModel {
|
|
userId: IUser['id']
|
|
right: Right
|
|
|
|
created: Date
|
|
updated: Date
|
|
}
|
|
|
|
export default class UserShareBaseModel extends AbstractModel implements IUserShareBase {
|
|
userId!: IUser['id']
|
|
right!: Right
|
|
|
|
created: Date
|
|
updated: Date
|
|
|
|
constructor(data) {
|
|
super(data)
|
|
this.created = new Date(this.created)
|
|
this.updated = new Date(this.updated)
|
|
}
|
|
|
|
defaults() {
|
|
return {
|
|
userId: '',
|
|
right: RIGHTS.READ,
|
|
|
|
created: null,
|
|
updated: null,
|
|
}
|
|
}
|
|
} |