This commit is contained in:
Tom Moor
2019-06-18 23:39:29 -07:00
parent 86b2dbf5c8
commit e9e21f280e

View File

@@ -1,5 +1,5 @@
// @flow
import { filter } from 'lodash';
import { filter, orderBy } from 'lodash';
import { computed, action, runInAction } from 'mobx';
import invariant from 'invariant';
import { client } from 'utils/ApiClient';
@@ -22,6 +22,11 @@ export default class UsersStore extends BaseStore<User> {
return filter(this.orderedData, user => user.isAdmin);
}
@computed
get orderedData(): T[] {
return orderBy(Array.from(this.data.values()), 'name', 'asc');
}
@action
promote = (user: User) => {
return this.actionOnUser('promote', user);