Skip to content

Commit

Permalink
Merge pull request #371 from credebl/credential-definition-verificati…
Browse files Browse the repository at this point in the history
…on-fix

feat: credential definition based verification based on schema Id
  • Loading branch information
nishad-ayanworks authored Oct 19, 2023
2 parents cabb8ad + bd903a3 commit 0437408
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/api/verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const getProofAttributes=async (proofId:string)=>{

export const getCredentialDefinitionsForVerification = async (schemaId: string) => {
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
const url= `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.getCredDefBySchemaId}/${schemaId}/cred-defs`;
const url= `${apiRoutes.Verification.verificationCredDef}/${schemaId}`;

const axiosPayload = {
url,
Expand Down
8 changes: 4 additions & 4 deletions src/components/Verification/CredDefSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,11 @@ const CredDefSelection = () => {

const getCredDefs = async (schemaId: string) => {
setLoading(true)
const response = await getCredentialDefinitionsForVerification(schemaId,31);
const response = await getCredentialDefinitionsForVerification(schemaId);

const { data } = response as AxiosResponse

if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) {
const credDefs = data?.data?.data.map((ele: CredDefData) => {
const credDefs = data?.data?.map((ele: CredDefData) => {
return {
data: [{ data: ele?.tag ? ele?.tag : 'Not available' }, { data: ele?.credentialDefinitionId ? ele?.credentialDefinitionId : 'Not available' },
{ data: ele?.revocable === true ? <span className="text-blue-700 dark:text-white">Yes</span> : <span className="text-cyan-500 dark:text-white">No</span> },
Expand Down Expand Up @@ -99,9 +98,10 @@ const CredDefSelection = () => {
if (credDefs?.length === 0) {
setError('No Data Found')
}

setLoading(false)
setCredDefList(credDefs)
} else {
setLoading(false)
setError(response as string)
}

Expand Down
1 change: 1 addition & 0 deletions src/config/apiRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const apiRoutes = {
verifyCredential: '/proofs',
presentationVerification: '/proofs',
proofRequestAttributesVerification: '/proofs',
verificationCredDef: '/verifiation/cred-defs'
},
Agent: {
checkAgentHealth: '/agents/health',
Expand Down

0 comments on commit 0437408

Please sign in to comment.