Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Commit

Permalink
chore: add passthrough context on deprecated passthrough endpoints (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
asdfryan authored Oct 12, 2023
1 parent 20a08a8 commit 945019d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/api/routes/crm/v2/passthrough.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getDependencyContainer } from '@/dependency_container';
import { addLogContext } from '@supaglue/core/lib/logger';
import type {
SendPassthroughRequestPathParams,
SendPassthroughRequestRequest,
Expand All @@ -20,6 +21,12 @@ export default function init(app: Router): void {
res: Response<SendPassthroughRequestResponse>
) => {
const response = await passthroughService.send(req.customerConnection.id, req.body);
addLogContext('passthrough', {
method: req.body.method,
path: req.body.path,
headers: req.body.headers,
query: req.body.query,
});
return res.status(200).send(response);
}
);
Expand Down
7 changes: 7 additions & 0 deletions apps/api/routes/engagement/v2/passthrough.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getDependencyContainer } from '@/dependency_container';
import { addLogContext } from '@supaglue/core/lib/logger';
import type {
SendPassthroughRequestPathParams,
SendPassthroughRequestRequest,
Expand All @@ -19,6 +20,12 @@ export default function init(app: Router): void {
req: Request<SendPassthroughRequestPathParams, SendPassthroughRequestResponse, SendPassthroughRequestRequest>,
res: Response<SendPassthroughRequestResponse>
) => {
addLogContext('passthrough', {
method: req.body.method,
path: req.body.path,
headers: req.body.headers,
query: req.body.query,
});
const response = await passthroughService.send(req.customerConnection.id, req.body);
return res.status(200).send(response);
}
Expand Down

0 comments on commit 945019d

Please sign in to comment.