From bd0a1d5edbfc7a239a97edb85ff3aea439d908a2 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 8 Jul 2017 22:36:59 -0700 Subject: [PATCH] Fix flow issues --- server/presenters/document.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/presenters/document.js b/server/presenters/document.js index 58607297..a3c9162a 100644 --- a/server/presenters/document.js +++ b/server/presenters/document.js @@ -31,6 +31,7 @@ async function present(ctx: Object, document: Document, options: ?Options) { team: document.teamId, collaborators: [], starred: !!document.starred, + collaboratorCount: undefined, collection: undefined, views: undefined, }; @@ -47,12 +48,12 @@ async function present(ctx: Object, document: Document, options: ?Options) { if (options.includeCollaborators) { // This could be further optimized by using ctx.cache - data['collaborators'] = await User.findAll({ + data.collaborators = await User.findAll({ where: { id: { $in: _.takeRight(document.collaboratorIds, 10) || [] }, }, }).map(user => presentUser(ctx, user)); - // $FlowIssue not found in object literal? + data.collaboratorCount = document.collaboratorIds.length; }