mirror of
https://github.com/outline/outline.git
synced 2026-12-02 09:42:07 +03:00
perf: One less query in documents.info
This commit is contained in:
1 parent
40b1e3c8c6
commit
fa117870a2
1 file changed
+7
-6
@@ -573,12 +573,13 @@ router.post(
|
||||
teamId: teamFromCtx?.id,
|
||||
});
|
||||
const isPublic = cannot(user, "read", document);
|
||||
const serializedDocument = await presentDocument(ctx, document, {
|
||||
isPublic,
|
||||
shareId,
|
||||
});
|
||||
|
||||
const team = await document.$get("team");
|
||||
const [serializedDocument, team] = await Promise.all([
|
||||
presentDocument(ctx, document, {
|
||||
isPublic,
|
||||
shareId,
|
||||
}),
|
||||
teamFromCtx?.id === document.teamId ? teamFromCtx : document.$get("team"),
|
||||
]);
|
||||
|
||||
// Passing apiVersion=2 has a single effect, to change the response payload to
|
||||
// include top level keys for document, sharedTree, and team.
|
||||
|
||||
Reference in new issue
Block a user