From 31f5a45db365aae54827de84b3fcd9b7116e0376 Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 15 Oct 2024 12:30:52 -0300 Subject: [PATCH] fix: missing registration uri for vouchers when profile has been transferred --- package.json | 3 ++- src/data/sanitizer.ts | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index e3a0338..71f8fd2 100644 --- a/package.json +++ b/package.json @@ -78,5 +78,6 @@ "wagmi": "wagmi generate", "tsc": "tsc --noEmit && next lint", "func": "netlify dev" - } + }, + "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610" } diff --git a/src/data/sanitizer.ts b/src/data/sanitizer.ts index 8a5c236..1a75549 100644 --- a/src/data/sanitizer.ts +++ b/src/data/sanitizer.ts @@ -58,7 +58,7 @@ export const sanitizeRequest = async (request: RequestQuery['request'], chainId: request.humanity.winnerClaim[0].evidenceGroup.evidence = transferringRequest?.evidenceGroup.evidence as any; } else { //request.humanity = transferringRequestComplete?.humanity as any; - request.claimer = transferringRequestComplete?.claimer as any; + request.claimer.name = transferringRequestComplete?.claimer.name as any; request.evidenceGroup = transferringRequestComplete?.evidenceGroup as any; //request.challenges = transferringRequestComplete?.challenges as any; } @@ -295,8 +295,9 @@ export const sanitizeClaimerData = async (out: Record 0 && - out[voucherEvidenceChain.id].claimer!.registration!.humanity.winnerClaim.at(0)!.evidenceGroup.evidence.length===0; + out[voucherEvidenceChain.id].claimer!.registration!.humanity.winnerClaim.length == 0 || + (out[voucherEvidenceChain.id].claimer!.registration!.humanity.winnerClaim.length > 0 && + out[voucherEvidenceChain.id].claimer!.registration!.humanity.winnerClaim.at(0)!.evidenceGroup.evidence.length===0); if (isClaimerIncomplete) { const lastTransf = await getProfileLastTransferringRequest(voucherEvidenceChain.id, id); @@ -318,7 +319,14 @@ export const sanitizeClaimerData = async (out: Record