Skip to content

Commit 11a6246

Browse files
authored
Add case array to transformLink
1 parent a983201 commit 11a6246

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/lib/utils/api.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,16 @@ export class ContentWrapper {
143143
await this.client.getContentType(link.sys.contentType.sys.id)
144144
);
145145

146+
case "Array":
147+
const transformedArray = await Promise.all(
148+
res[id].map((link: any) =>
149+
this.transformLink(link, field.items!.linkType)
150+
)
151+
);
152+
// Filter out any undefined items that were unpublished
153+
res[id] = transformedArray.filter((item) => item !== undefined);
154+
break;
155+
146156
case undefined:
147157
return link;
148158
}

0 commit comments

Comments
 (0)