parent
e38f4996ae
commit
aa61c37442
|
@ -158,8 +158,8 @@ export default class Document extends BaseModel {
|
|||
};
|
||||
|
||||
@action
|
||||
view = async () => {
|
||||
await client.post('/views.create', { documentId: this.id });
|
||||
view = () => {
|
||||
return this.store.rootStore.views.create({ documentId: this.id });
|
||||
};
|
||||
|
||||
@action
|
||||
|
|
|
@ -5,7 +5,7 @@ import RootStore from './RootStore';
|
|||
import View from 'models/View';
|
||||
|
||||
export default class ViewsStore extends BaseStore<View> {
|
||||
actions = ['list'];
|
||||
actions = ['list', 'create'];
|
||||
|
||||
constructor(rootStore: RootStore) {
|
||||
super(rootStore, View);
|
||||
|
|
Reference in New Issue