From c5df7d1d64df8134a894ab29b604ea460d8c9a36 Mon Sep 17 00:00:00 2001 From: Simone Radtke Date: Fri, 27 Oct 2023 19:55:40 +0200 Subject: [PATCH] EW-539 Adjust if statement --- .../service/common-cartridge-export.service.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/server/src/modules/learnroom/service/common-cartridge-export.service.ts b/apps/server/src/modules/learnroom/service/common-cartridge-export.service.ts index 6472fd8f76f..83fd91edfc6 100644 --- a/apps/server/src/modules/learnroom/service/common-cartridge-export.service.ts +++ b/apps/server/src/modules/learnroom/service/common-cartridge-export.service.ts @@ -132,14 +132,10 @@ export class CommonCartridgeExportService { if (content.component === ComponentType.LERNSTORE) { if (content.content && Array.isArray(content.content.resources) && content.content.resources.length > 0) { content.content.resources.map((resource) => { - return { - ...commonProps, - type: - version === CommonCartridgeVersion.V_1_3_0 - ? CommonCartridgeResourceType.WEB_LINK_V3 - : CommonCartridgeResourceType.WEB_LINK_V1, - url: resource.url, - }; + const url = resource.url; + return version === CommonCartridgeVersion.V_1_3_0 + ? { ...commonProps, type: CommonCartridgeResourceType.WEB_LINK_V3, url } + : { ...commonProps, type: CommonCartridgeResourceType.WEB_LINK_V1, url }; }); } }