From ebede540c340124ac0089c29db1811ff07218cc7 Mon Sep 17 00:00:00 2001 From: "XITASO\\pawel.baran" Date: Wed, 4 Dec 2024 16:56:40 +0100 Subject: [PATCH] fix(TransferService)-fix-url-attachments-as-files --- src/lib/services/transfer-service/TransferService.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/services/transfer-service/TransferService.ts b/src/lib/services/transfer-service/TransferService.ts index 0dd90b0..bdc852d 100644 --- a/src/lib/services/transfer-service/TransferService.ts +++ b/src/lib/services/transfer-service/TransferService.ts @@ -26,6 +26,7 @@ import { createSubmodelDescriptorFromSubmodel, } from 'lib/services/transfer-service/TransferUtil'; import { ApiResponseWrapperError } from 'lib/util/apiResponseWrapper/apiResponseWrapper'; +import { isValidUrl } from 'lib/util/UrlUtil'; export enum ServiceReachable { Yes = 'Yes', @@ -467,9 +468,13 @@ export class TransferService { } if (modelType === KeyTypes.File) { + const submodelEl = subEl as aasCoreFile; + if (isValidUrl(submodelEl.value ?? '')) { + return; + } submodelAttachmentsDetails.push({ idShortPath: idShortPath, - fileName: [(subEl as aasCoreFile).idShort, generateRandomId()].join(''), + fileName: [submodelEl.idShort, generateRandomId()].join(''), }); } }