From 474388b68910a6363c203c92af3a249719176abf Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Mon, 9 Dec 2024 11:01:05 +0700 Subject: [PATCH] fix: update the passport extraction linkSet to sustainabilityInfo --- docker-compose.yml | 2 +- packages/services/src/identityProviders/GS1Provider.ts | 1 + packages/services/src/linkResolver.service.ts | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 017f58c5..3cd6a08d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -117,7 +117,7 @@ services: mock-global-gs1-resolver-object-store: image: quay.io/minio/minio:RELEASE.2024-08-17T01-24-54Z-cpuv1 - command: server /data --console-address ":9091" + command: server /data --console-address ":9090" ports: - '9001:9000' - '9091:9090' diff --git a/packages/services/src/identityProviders/GS1Provider.ts b/packages/services/src/identityProviders/GS1Provider.ts index ff16cf60..a0cca90b 100644 --- a/packages/services/src/identityProviders/GS1Provider.ts +++ b/packages/services/src/identityProviders/GS1Provider.ts @@ -6,6 +6,7 @@ export enum GS1ServiceEnum { certificationInfo = 'voc/certificationInfo', verificationService = 'voc/verificationService', serviceInfo = 'voc/serviceInfo', + sustainabilityInfo = 'voc/sustainabilityInfo' } export class GS1Provider implements IdentityProviderStrategy { diff --git a/packages/services/src/linkResolver.service.ts b/packages/services/src/linkResolver.service.ts index 044620c7..de89c0f4 100644 --- a/packages/services/src/linkResolver.service.ts +++ b/packages/services/src/linkResolver.service.ts @@ -242,14 +242,14 @@ export const getDlrPassport = async (dlrUrl: string): Promise => { // Find certificate passports in the DLR data const certificatePassports = dlrData?.linkset?.find( - (linkSetItem: any) => linkSetItem[`${rootDlrDomain}/${GS1ServiceEnum.certificationInfo}`], + (linkSetItem: any) => linkSetItem[`${rootDlrDomain}/${GS1ServiceEnum.sustainabilityInfo}`], ); if (!certificatePassports) { return null; } // Extract passport infos from certificate passports - const dlrPassports = certificatePassports[`${rootDlrDomain}/${GS1ServiceEnum.certificationInfo}`]; + const dlrPassports = certificatePassports[`${rootDlrDomain}/${GS1ServiceEnum.sustainabilityInfo}`]; if (!dlrPassports) { return null; }