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

33 lines
694 B
TypeScript
Raw Normal View History

2019-09-09 17:55:43 +00:00
import AbstractModel from './abstractModel'
import UserModel from './user'
2022-06-23 01:14:58 +00:00
import {RIGHTS, type Right} from '@/models/constants/rights'
2019-09-09 17:55:43 +00:00
export default class LinkShareModel extends AbstractModel {
2019-09-09 17:55:43 +00:00
constructor(data) {
// The constructor of AbstractModel handles all the default parsing.
super(data)
2019-09-09 17:55:43 +00:00
this.sharedBy = new UserModel(this.sharedBy)
this.created = new Date(this.created)
this.updated = new Date(this.updated)
}
2019-09-09 17:55:43 +00:00
// Default attributes that define the "empty" state.
defaults() {
return {
id: 0,
hash: '',
2022-06-23 01:14:58 +00:00
right: RIGHTS.READ,
sharedBy: UserModel,
sharingType: 0,
listId: 0,
name: '',
password: '',
2019-09-09 17:55:43 +00:00
created: null,
updated: null,
}
}
2019-09-09 17:55:43 +00:00
}