From 0657d37f6cbf2c1c5d1661a4572475252c4e12a3 Mon Sep 17 00:00:00 2001 From: mohamedalichelbi Date: Fri, 12 Apr 2024 16:38:57 +0200 Subject: [PATCH] fix gh-actions build errors --- src/pages/verifier/tabs/admin.tsx | 11 ++++++----- src/utils/api.ts | 11 ++++++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/pages/verifier/tabs/admin.tsx b/src/pages/verifier/tabs/admin.tsx index 0e7056b..1250b8c 100644 --- a/src/pages/verifier/tabs/admin.tsx +++ b/src/pages/verifier/tabs/admin.tsx @@ -22,11 +22,12 @@ export function AdminsTab() { const fetchData = async () => { const res = await getPresentations() - setPresentations(res.map((x, index) => { - x["id"] = index; - x["cred_schemas"] = x["cred_schemas"].map((y: string) => atob(y)); - return x; - })); + setPresentations(res.map((x, index) => ({ + ...x, + id: index, + cred_schemas: x["cred_schemas"].map((y: string) => atob(y)), + + }))); } const handleChange = (event: React.ChangeEvent) => { diff --git a/src/utils/api.ts b/src/utils/api.ts index da4e97a..5ef2655 100644 --- a/src/utils/api.ts +++ b/src/utils/api.ts @@ -94,7 +94,16 @@ export async function getProofStatus(taskId: number): Promise { return (await fetch(`${getBackendUrl()}/holder/proof/status/${taskId}`)).json() } -export async function getPresentations(): Promise { +type Request = { + status: string, + cred_hashes: string[], + cred_schemas: string[], + lang: string, + script: string, + result: boolean, +}; + +export async function getPresentations(): Promise { return (await fetch(`${getBackendUrl()}/verifier/presentations`)).json() }