Admin endpoints
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
// @flow
|
||||
import _ from 'lodash';
|
||||
import { Op } from 'sequelize';
|
||||
import { User, Document } from '../models';
|
||||
import presentUser from './user';
|
||||
import presentCollection from './collection';
|
||||
@ -57,7 +58,7 @@ async function present(ctx: Object, document: Document, options: ?Options) {
|
||||
// This could be further optimized by using ctx.cache
|
||||
data.collaborators = await User.findAll({
|
||||
where: {
|
||||
id: { $in: _.takeRight(document.collaboratorIds, 10) || [] },
|
||||
id: { [Op.in]: _.takeRight(document.collaboratorIds, 10) || [] },
|
||||
},
|
||||
}).map(user => presentUser(ctx, user));
|
||||
|
||||
|
Reference in New Issue
Block a user