diff --git a/.changeset/fresh-hornets-fly.md b/.changeset/fresh-hornets-fly.md new file mode 100644 index 00000000000..593c5bbc065 --- /dev/null +++ b/.changeset/fresh-hornets-fly.md @@ -0,0 +1,5 @@ +--- +"@wso2is/console": patch +--- + +Prevent API call with filter attribute tags for the IDP list endpoint diff --git a/apps/console/src/features/connections/api/connections.ts b/apps/console/src/features/connections/api/connections.ts index 4e9ee7d24bd..012b224b22d 100644 --- a/apps/console/src/features/connections/api/connections.ts +++ b/apps/console/src/features/connections/api/connections.ts @@ -93,6 +93,8 @@ export const createConnection = ( * @param offset - Offset for get to start. * @param filter - Search filter. * @param requiredAttributes - Extra attribute to be included in the list response. ex:`isFederationHub` + * @param shouldFetch - Should fetch from the network. If false, will return results from cache. + * @param expectEmpty - If true, will allow returning empty results. * * @returns Requested connections. */ @@ -101,7 +103,8 @@ export const useGetConnections = => { const { resourceEndpoints } = useResourceEndpoints(); @@ -126,7 +129,7 @@ export const useGetConnections = = (props: ConnectionsPropsI const [ localAuthenticatorList, setLocalAuthenticatorList ] = useState([]); const [ filteredAuthenticatorList, setFilteredAuthenticatorList ] = useState([]); const [ filter, setFilter ] = useState(null); + const [ filterAuthenticatorsOnly, setFilterAuthenticatorsOnly ] = useState(false); const [ appendConnections, setAppendConnections ] = useState(false); const isPaginating: boolean = false; @@ -122,7 +123,14 @@ const ConnectionsPage: FC = (props: ConnectionsPropsI isLoading: isConnectionsFetchRequestLoading, error: connectionsFetchRequestError, mutate: mutateConnectionsFetchRequest - } = useGetConnections(listItemLimit, listOffset, filter, "federatedAuthenticators"); + } = useGetConnections( + listItemLimit, + listOffset, + filter, + "federatedAuthenticators", + !filterAuthenticatorsOnly, + filterAuthenticatorsOnly + ); const { data: authenticatorTags, @@ -381,6 +389,7 @@ const ConnectionsPage: FC = (props: ConnectionsPropsI setSelectedFilterTags(filterTags); setFilter(ConnectionsManagementUtils.buildAuthenticatorsFilterQuery(query, filterTags)); + setFilterAuthenticatorsOnly(filterTags && filterTags.length > 0); if (isEmpty(query) && isEmpty(filterTags)) { setShowFilteredList(false);