diff --git a/src/api/issuance.ts b/src/api/issuance.ts index 41759e035..01289f2ff 100644 --- a/src/api/issuance.ts +++ b/src/api/issuance.ts @@ -4,9 +4,9 @@ import { getHeaderConfigs } from '../config/GetHeaderConfigs'; import { axiosGet, axiosPost } from '../services/apiRequests'; import { getFromLocalStorage } from './Auth'; -export const getIssuedCredentials = async (schemaId: string) => { +export const getIssuedCredentials = async () => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID); - const url= `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.getCredDefBySchemaId}/${schemaId}/cred-defs`; + const url= `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.getIssuedCredentials}`; const axiosPayload = { url, @@ -22,6 +22,7 @@ export const getIssuedCredentials = async (schemaId: string) => { }; export const getCredentialDefinitions = async (schemaId: string) => { + const orgId = await getFromLocalStorage(storageKeys.ORG_ID); const url= `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.getCredDefBySchemaId}/${schemaId}/cred-defs`; @@ -41,7 +42,9 @@ export const getCredentialDefinitions = async (schemaId: string) => { export const issueCredential = async (data: object) => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID); - const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.issueCredential}`; const payload = data; + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.issueCredential}`; + const payload = data; + const axiosPayload = { url, payload, diff --git a/src/api/verification.ts b/src/api/verification.ts index d59b9c964..f962fff52 100644 --- a/src/api/verification.ts +++ b/src/api/verification.ts @@ -24,7 +24,6 @@ export const verifyCredential = async (payload: any) => { export const getVerificationCredential = async (state: IssueCredential) => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID); const url = `${apiRoutes.Issuance.getIssuedCredentials}?orgId=${orgId}&state=${state}`; - const axiosPayload = { url, config: await getHeaderConfigs(), @@ -40,7 +39,8 @@ export const getVerificationCredential = async (state: IssueCredential) => { export const getVerificationList = async () => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID); - const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Verification.getAllRequestList}` + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Verification.verifyCredential}` + const axiosPayload = { url, config: await getHeaderConfigs(), @@ -88,7 +88,9 @@ export const getProofAttributes=async (proofId:string)=>{ } export const getCredentialDefinitionsForVerification = async (schemaId: string) => { - const url = `${apiRoutes.schema.getCredDefBySchemaId}?schemaId=${schemaId}`; + const orgId = await getFromLocalStorage(storageKeys.ORG_ID); + const url= `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.getCredDefBySchemaId}/${schemaId}/cred-defs`; + const axiosPayload = { url, config: await getHeaderConfigs(), diff --git a/src/components/AlertComponent/index.tsx b/src/components/AlertComponent/index.tsx index 89d2ef8b2..1dee1f119 100644 --- a/src/components/AlertComponent/index.tsx +++ b/src/components/AlertComponent/index.tsx @@ -1,6 +1,7 @@ import { Alert } from 'flowbite-react'; +import { pathRoutes } from '../../config/pathRoutes'; -export const AlertComponent = ({ message, type, viewButton, onAlertClose }: { message: string | null, type: string, viewButton?: boolean, onAlertClose: () => void }) => { +export const AlertComponent = ({ message, type, viewButton, onAlertClose, goToInvite }: { message: string | null, type: string, viewButton?: boolean,goToInvite?:boolean, onAlertClose: () => void }) => { return message !== null ? - View more... + {goToInvite ? View more... :"View more..." }

} @@ -24,4 +25,4 @@ export const AlertComponent = ({ message, type, viewButton, onAlertClose }: { me
: <> -} \ No newline at end of file +} diff --git a/src/components/Issuance/CredDefSelection.tsx b/src/components/Issuance/CredDefSelection.tsx index fe59801ba..53ebd58a1 100644 --- a/src/components/Issuance/CredDefSelection.tsx +++ b/src/components/Issuance/CredDefSelection.tsx @@ -67,6 +67,7 @@ const CredDefSelection = () => { const getCredDefs = async (schemaId: string) => { setLoading(true) const response = await getCredentialDefinitions(schemaId); + const { data } = response as AxiosResponse if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { diff --git a/src/components/Issuance/IssuedCrdentials.tsx b/src/components/Issuance/IssuedCrdentials.tsx index e938aeaee..894d45214 100644 --- a/src/components/Issuance/IssuedCrdentials.tsx +++ b/src/components/Issuance/IssuedCrdentials.tsx @@ -36,12 +36,12 @@ const CredentialList = () => { const getIssuedCredDefs = async () => { setLoading(true); - const response = await getIssuedCredentials( - IssueCredential.credentialIssued, - ); + const response = await getIssuedCredentials(); + const { data } = response as AxiosResponse; if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { + const credentialList = data?.data?.map( (issuedCredential: IssuedCredential) => { const schemaName = issuedCredential.metadata['_anoncreds/credential'] @@ -51,6 +51,7 @@ const CredentialList = () => { .slice(2) .join(':') : 'Not available'; + return { data: [ { diff --git a/src/components/Resources/Schema/Create.tsx b/src/components/Resources/Schema/Create.tsx index 76f212f9d..fd1e61417 100644 --- a/src/components/Resources/Schema/Create.tsx +++ b/src/components/Resources/Schema/Create.tsx @@ -27,7 +27,6 @@ import React from 'react'; const [orgId, setOrgId] = useState(0); const [orgDid, setOrgDid] = useState(''); const [createloader, setCreateLoader] = useState(false); - useEffect(() => { const fetchData = async () => { const organizationId = await getFromLocalStorage( @@ -540,7 +539,6 @@ import React from 'react'; No, cancel