diff --git a/apps/idos-data-dashboard/src/main.tsx b/apps/idos-data-dashboard/src/main.tsx index e3989cf68..bc8f60a03 100644 --- a/apps/idos-data-dashboard/src/main.tsx +++ b/apps/idos-data-dashboard/src/main.tsx @@ -29,7 +29,7 @@ ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( - {/* @ts-expect-error: TODO: fix wagmi types */} + {/* @ts-ignore: TODO: fix wagmi types */} diff --git a/apps/idos-data-dashboard/src/routes/dashboard/credentials/index.tsx b/apps/idos-data-dashboard/src/routes/dashboard/credentials/index.tsx index e13f214df..ecbd53400 100644 --- a/apps/idos-data-dashboard/src/routes/dashboard/credentials/index.tsx +++ b/apps/idos-data-dashboard/src/routes/dashboard/credentials/index.tsx @@ -37,29 +37,7 @@ const useFetchCredentials = () => { .map((c) => c.id), })) as idOSCredentialWithShares[]; // @todo: remove once we have more type safety in the SDK. }, - select: (credentials) => - credentials - .filter((credential) => !credential.original_id) - - .map((credential) => { - const { credential_level, credential_status, credential_type, issuer } = - // biome-ignore lint/suspicious/noExplicitAny: // @todo: remove once we have successfully migrated to Credentials 2.0. - credential as any; - const fields = credential.public_notes ? JSON.parse(credential.public_notes) : {}; - - const public_notes = { - id: fields.id ?? credential.id, - level: fields.level ?? credential_level, - status: fields.status ?? credential_status, - type: fields.type ?? credential_type, - issuer: fields.issuer ?? issuer, - }; - - return { - ...credential, - public_notes: JSON.stringify(public_notes), - }; - }), + select: (credentials) => credentials.filter((credential) => !credential.original_id), }); }; diff --git a/examples/idos-example-dapp/src/main.js b/examples/idos-example-dapp/src/main.js index eeca74685..d0ddc5e3e 100644 --- a/examples/idos-example-dapp/src/main.js +++ b/examples/idos-example-dapp/src/main.js @@ -200,30 +200,7 @@ const connectWallet = { let credentials = await terminal .h1("eyes", "User's credentials") .wait("awaiting signature", cache.get("credentials") || idos.data.list("credentials")); - credentials = credentials - .filter((c) => c.original_id === null) - // @todo: remove once we have successfully migrated to Credentials 2.0. - .map((credential) => { - const { credential_level, credential_status, credential_type, issuer } = credential; - const _fields = credential.public_notes - ? typeof credential.public_notes === "string" - ? JSON.parse(credential.public_notes) - : credential.public_notes - : {}; - const { id, ...public_notes } = { - id: _fields.id ?? credential.id, - level: _fields.level ?? credential_level, - status: _fields.status ?? credential_status, - type: _fields.type ?? credential_type, - issuer: _fields.issuer ?? issuer, - }; - - return { - ...credential, - ...public_notes, - public_notes, - }; - }); + credentials = credentials.filter((c) => c.original_id === null); cache.set("credentials", credentials); diff --git a/examples/issuer-sdk-demo/src/app/page.tsx b/examples/issuer-sdk-demo/src/app/page.tsx index 48311b50c..fd23e4609 100644 --- a/examples/issuer-sdk-demo/src/app/page.tsx +++ b/examples/issuer-sdk-demo/src/app/page.tsx @@ -58,26 +58,7 @@ export default function Home() { // @ts-expect-error: types in the SDK are a bit messy. await _instance.setSigner("EVM", signer); const _credentials = await _instance.data.list("credentials"); - setCredentials( - _credentials.map((credential) => { - const { credential_level, credential_status, credential_type, issuer } = - // biome-ignore lint/suspicious/noExplicitAny: // @todo: remove once we have successfully migrated to Credentials 2.0. - credential as any; - const fields = credential.public_notes ? JSON.parse(credential.public_notes) : {}; - - const public_notes = { - id: fields.id ?? credential.id, - level: fields.level ?? credential_level, - status: fields.status ?? credential_status, - type: fields.type ?? credential_type, - issuer: fields.issuer ?? issuer, - }; - return { - ...credential, - public_notes: JSON.stringify(public_notes), - }; - }), - ); + setCredentials(_credentials); } setHasProfile(_hasProfile);