Skip to content

Commit

Permalink
Merge pull request #51 from credebl/refactor/schema-cred-def
Browse files Browse the repository at this point in the history
fix: Added missing state for schema list error
  • Loading branch information
nishad-ayanworks authored Jul 31, 2023
2 parents 638e128 + 4b27090 commit 543b194
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Resources/Schema/Schemas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const SchemaList = () => {

const schemaList = await getAllSchemas(schemaListAPIParameter, organizationId);
const { data } = schemaList as AxiosResponse;

if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) {
if (data?.data?.data?.length === 0) {
setSchemaListErr('No Data Found');
Expand All @@ -44,9 +44,11 @@ const SchemaList = () => {
setLoading(false);
} else {
setLoading(false);
setSchemaListErr(schemaList as string)
}
} else {
setLoading(false);
setSchemaListErr(schemaList as string)
}
} catch (error) {
console.error('Error while fetching schema list:', error);
Expand Down

0 comments on commit 543b194

Please sign in to comment.