a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

don't close postgres client within transaction

+4 -4
+4 -4
components/ShareOptions/getShareLink.ts
··· 10 10 token: { id: string; entity_set: string }, 11 11 rootEntity: string, 12 12 ) { 13 - return await db.transaction(async (tx) => { 13 + let link = await db.transaction(async (tx) => { 14 14 // This will likely error out when if we have multiple permission 15 15 // token rights associated with a single token 16 16 let [tokenW] = await tx ··· 27 27 tokenW.permission_tokens.root_entity !== rootEntity || 28 28 tokenW.permission_token_rights.entity_set !== token.entity_set 29 29 ) { 30 - client.end(); 31 30 return null; 32 31 } 33 32 ··· 49 48 ), 50 49 ); 51 50 if (existingToken) { 52 - client.end(); 53 51 return existingToken.permission_tokens; 54 52 } 55 53 let [newToken] = await tx ··· 64 62 create_token: false, 65 63 change_entity_set: false, 66 64 }); 67 - client.end(); 68 65 return newToken; 69 66 }); 67 + 68 + client.end(); 69 + return link; 70 70 }