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
|
|
|
|
2022-02-13 17:11:26 +00:00
|
|
|
export default class LinkShareModel extends AbstractModel {
|
2019-09-09 17:55:43 +00:00
|
|
|
|
2020-09-05 20:35:52 +00:00
|
|
|
constructor(data) {
|
|
|
|
// The constructor of AbstractModel handles all the default parsing.
|
|
|
|
super(data)
|
2019-09-09 17:55:43 +00:00
|
|
|
|
2020-09-05 20:35:52 +00:00
|
|
|
this.sharedBy = new UserModel(this.sharedBy)
|
2020-02-08 13:16:06 +00:00
|
|
|
|
2020-09-05 20:35:52 +00:00
|
|
|
this.created = new Date(this.created)
|
|
|
|
this.updated = new Date(this.updated)
|
|
|
|
}
|
2019-09-09 17:55:43 +00:00
|
|
|
|
2020-09-05 20:35:52 +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,
|
2020-09-05 20:35:52 +00:00
|
|
|
sharedBy: UserModel,
|
|
|
|
sharingType: 0,
|
|
|
|
listId: 0,
|
2021-04-07 12:44:54 +00:00
|
|
|
name: '',
|
2021-04-11 13:18:19 +00:00
|
|
|
password: '',
|
2019-09-09 17:55:43 +00:00
|
|
|
|
2020-09-05 20:35:52 +00:00
|
|
|
created: null,
|
|
|
|
updated: null,
|
|
|
|
}
|
|
|
|
}
|
2019-09-09 17:55:43 +00:00
|
|
|
}
|