fix: View does not appear for first ever view

closes #1152
This commit is contained in:
Tom Moor 2020-01-11 13:54:49 -08:00
parent e38f4996ae
commit aa61c37442
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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);