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