Skip to content

Commit

Permalink
Update render-documents.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
aacebo committed Mar 26, 2024
1 parent 585c33d commit 5ae83d8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/samples/08.semanticSearch/src/actions/render-documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function renderDocuments() {
for (const document of params.documents) {
const item = (await client.getDriveItem(document.siteId, document.id)).data;
const thumbnails = (await client.getDriveItemThumbnails(document.siteId, document.id)).data;
const thumbnail = thumbnails.value[0].small || thumbnails.value[0].medium || thumbnails.value[0].large

attachments.push(CardFactory.adaptiveCard({
$schema: 'http://adaptivecards.io/schemas/adaptive-card.json',
Expand All @@ -46,9 +47,9 @@ export function renderDocuments() {
items: [
{
type: 'Image',
url: thumbnails.value[0].small.url,
height: `${thumbnails.value[0].small.height}px`,
width: `${thumbnails.value[0].small.width}px`
url: thumbnail.url,
height: `${thumbnail.height}px`,
width: `${thumbnail.width}px`
}
]
},
Expand Down

0 comments on commit 5ae83d8

Please sign in to comment.