Skip to content

Commit

Permalink
fix(TransferService)-fix-url-attachments-as-files
Browse files Browse the repository at this point in the history
  • Loading branch information
pawel-baran-se committed Dec 4, 2024
1 parent 6fa448d commit ebede54
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/services/transfer-service/TransferService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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(''),
});
}
}
Expand Down

0 comments on commit ebede54

Please sign in to comment.