Skip to content

Commit

Permalink
fix: update the passport extraction linkSet to sustainabilityInfo (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
huynguyen-hl authored Dec 10, 2024
1 parent a31be9e commit afaccbc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions packages/services/src/identityProviders/GS1Provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export enum GS1ServiceEnum {
certificationInfo = 'voc/certificationInfo',
verificationService = 'voc/verificationService',
serviceInfo = 'voc/serviceInfo',
sustainabilityInfo = 'voc/sustainabilityInfo'
}

export class GS1Provider implements IdentityProviderStrategy {
Expand Down
4 changes: 2 additions & 2 deletions packages/services/src/linkResolver.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,14 @@ export const getDlrPassport = async <T>(dlrUrl: string): Promise<T | null> => {

// 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;
}
Expand Down

0 comments on commit afaccbc

Please sign in to comment.