feat: improve tree and registration

This commit is contained in:
turnoffthiscomputer
2025-03-11 20:48:21 +01:00
parent e741091c98
commit 21b38626ca
3 changed files with 5 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ export const DSC_TREE_URL = 'https://tree.self.xyz/dsc';
export const CSCA_TREE_URL_STAGING = 'https://tree.staging.self.xyz/csca';
export const DSC_TREE_URL_STAGING = 'https://tree.staging.self.xyz/dsc';
export const IDENTITY_TREE_URL = 'https://tree.self.xyz/identity';
export const IDENTITY_TREE_URL_STAGING = 'https://tree.staging.self.xyz/identity';
export const PASSPORT_ATTESTATION_ID = '1'; //"8518753152044246090169372947057357973469996808638122125210848696986717482788"

View File

@@ -47,7 +47,7 @@ export async function getDSCTree(endpointType: EndpointType): Promise<string> {
}
export async function getCommitmentTree(documentType: DocumentType | null): Promise<string> {
const identityTreeUrl = documentType === null || documentType === 'passport' ? IDENTITY_TREE_URL : IDENTITY_TREE_URL_STAGING;
const identityTreeUrl = !documentType || typeof documentType !== 'string' || documentType === 'passport' ? IDENTITY_TREE_URL : IDENTITY_TREE_URL_STAGING;
const response = await fetch(identityTreeUrl);
return await response.json().then(data => data.data ? data.data : data);
}