Separated user and auth stores

This commit is contained in:
Jori Lallo
2017-05-29 19:08:03 -07:00
parent 98a5283e27
commit 0d87d6abf5
12 changed files with 191 additions and 143 deletions

View File

@ -2,6 +2,7 @@
import { observable, action, runInAction, ObservableArray } from 'mobx';
import ApiClient, { client } from 'utils/ApiClient';
import _ from 'lodash';
import invariant from 'invariant';
import stores from 'stores';
import Collection from 'models/Collection';
@ -26,6 +27,7 @@ class CollectionsStore {
const res = await this.client.post('/collections.list', {
id: this.teamId,
});
invariant(res && res.data, 'Collection list not available');
const { data } = res;
runInAction('CollectionsStore#fetch', () => {
this.data.replace(