Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Commit

Permalink
fix: add userId in upload-file and mail-attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
munkhorgil committed Apr 8, 2020
1 parent 1934484 commit 7e86c2d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ app.get('/read-mail-attachment', async (req: any, res) => {
const integrationPath = kind.includes('nylas') ? 'nylas' : kind;

res.redirect(
`${INTEGRATIONS_API_DOMAIN}/${integrationPath}/get-attachment?messageId=${messageId}&attachmentId=${attachmentId}&integrationId=${integrationId}&filename=${filename}&contentType=${contentType}&=userId${req.user._id}`,
`${INTEGRATIONS_API_DOMAIN}/${integrationPath}/get-attachment?messageId=${messageId}&attachmentId=${attachmentId}&integrationId=${integrationId}&filename=${filename}&contentType=${contentType}&userId=${req.user._id}`,
);
});

Expand All @@ -223,8 +223,6 @@ app.post('/upload-file', async (req: any, res, next) => {
if (req.query.kind === 'nylas') {
debugExternalApi(`Pipeing request to ${INTEGRATIONS_API_DOMAIN}`);

req.headers.userId = req.user_id;

return req.pipe(
request
.post(`${INTEGRATIONS_API_DOMAIN}/nylas/upload`)
Expand Down

0 comments on commit 7e86c2d

Please sign in to comment.