Skip to content

Commit

Permalink
Fix attachmenturl thing to include response attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
mdial89f committed Nov 16, 2023
1 parent 7bb46f3 commit 04b6d9c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/services/api/handlers/getAttachmentUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ export const handler = async (event: APIGatewayEvent) => {

const allAttachments = [
...(results.hits.hits[0]._source.attachments || []),
...Object.values(results.hits.hits[0]._source.rais).flatMap(
(entry) => entry.request.attachments
),
...Object.values(results.hits.hits[0]._source.rais).flatMap((entry) => [
...(entry.request.attachments || []),
...(entry.response.attachments || []),
]),
];

if (
Expand Down

0 comments on commit 04b6d9c

Please sign in to comment.