From 8998fa5e7c206333ac11815fc90704f20d6cd06e Mon Sep 17 00:00:00 2001 From: SujanSanjula96 Date: Thu, 26 Oct 2023 17:37:59 +0530 Subject: [PATCH] Fix review comments --- .../features/applications/api/use-scopes-of-api-resources.ts | 5 ++--- .../applications/components/api-authorization/scope-form.tsx | 2 +- .../api-authorization/wizard/authorize-api-resource.tsx | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/console/src/features/applications/api/use-scopes-of-api-resources.ts b/apps/console/src/features/applications/api/use-scopes-of-api-resources.ts index 8b724bc88a1..31b7edbea16 100644 --- a/apps/console/src/features/applications/api/use-scopes-of-api-resources.ts +++ b/apps/console/src/features/applications/api/use-scopes-of-api-resources.ts @@ -33,8 +33,7 @@ import { AuthorizedPermissionListItemInterface } from "../models/api-authorizati * @throws `IdentityAppsApiException` */ const useScopesOfAPIResources = ( - apiResourceId: string, - shouldFetch?: boolean + apiResourceId: string ): RequestResultInterface => { const requestConfig: AxiosRequestConfig = { @@ -46,7 +45,7 @@ const useScopesOfAPIResources = (shouldFetch ? requestConfig: null); + const { data, error, isValidating, mutate } = useRequest(apiResourceId ? requestConfig: null); return { data, diff --git a/apps/console/src/features/applications/components/api-authorization/scope-form.tsx b/apps/console/src/features/applications/components/api-authorization/scope-form.tsx index 17b18258a96..7949eb338ce 100644 --- a/apps/console/src/features/applications/components/api-authorization/scope-form.tsx +++ b/apps/console/src/features/applications/components/api-authorization/scope-form.tsx @@ -99,7 +99,7 @@ export const ScopeForm: FunctionComponent = ( data: currentAPIResourceScopeListData, isLoading: isCurrentAPIResourceScopeListDataLoading, error: currentAPIResourceScopeListFetchError - } = useScopesOfAPIResources(subscribedAPIResource?.id, subscribedAPIResource?.id != null); + } = useScopesOfAPIResources(subscribedAPIResource?.id); /** * The following useEffect is used to handle if any error occurs while fetching API resource scopes. diff --git a/apps/console/src/features/applications/components/api-authorization/wizard/authorize-api-resource.tsx b/apps/console/src/features/applications/components/api-authorization/wizard/authorize-api-resource.tsx index 1b36cb148c4..a5e6e8a25e7 100644 --- a/apps/console/src/features/applications/components/api-authorization/wizard/authorize-api-resource.tsx +++ b/apps/console/src/features/applications/components/api-authorization/wizard/authorize-api-resource.tsx @@ -116,7 +116,7 @@ export const AuthorizeAPIResource: FunctionComponent