Upgrade to Flow 0.71
This commit is contained in:
@ -1,10 +1,12 @@
|
||||
// @flow
|
||||
import _ from 'lodash';
|
||||
import { Op } from 'sequelize';
|
||||
import Sequelize from 'sequelize';
|
||||
import { User, Document } from '../models';
|
||||
import presentUser from './user';
|
||||
import presentCollection from './collection';
|
||||
|
||||
const Op = Sequelize.Op;
|
||||
|
||||
type Options = {
|
||||
includeCollaborators?: boolean,
|
||||
};
|
||||
@ -61,7 +63,10 @@ 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: { [Op.in]: _.takeRight(document.collaboratorIds, 10) || [] },
|
||||
id: {
|
||||
// $FlowFixMe
|
||||
[Op.in]: _.takeRight(document.collaboratorIds, 10) || [],
|
||||
},
|
||||
},
|
||||
}).map(user => presentUser(ctx, user));
|
||||
|
||||
|
Reference in New Issue
Block a user