diff --git a/src/services/api/handlers/getAttachmentUrl.ts b/src/services/api/handlers/getAttachmentUrl.ts index 32513b34e..b1d3f1046 100644 --- a/src/services/api/handlers/getAttachmentUrl.ts +++ b/src/services/api/handlers/getAttachmentUrl.ts @@ -49,8 +49,10 @@ export const handler = async (event: APIGatewayEvent) => { } const allAttachments = [ - ...results.hits[0]._source.attachments, - ...results.hits[0]._source.raiResponses.map((R) => R.attachments).flat(), + ...results.hits.hits[0]._source.attachments, + ...results.hits.hits[0]._source.raiResponses + .map((R) => R.attachments) + .flat(), ]; if (