mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 03:31:27 +00:00
misc: added proper error handling
This commit is contained in:
@@ -13,9 +13,15 @@ export const useGetLDAPConfig = (organizationId: string) => {
|
||||
return useQuery({
|
||||
queryKey: ldapConfigKeys.getLDAPConfig(organizationId),
|
||||
queryFn: async () => {
|
||||
const { data } = await apiRequest.get(`/api/v1/ldap/config?organizationId=${organizationId}`);
|
||||
try {
|
||||
const { data } = await apiRequest.get(
|
||||
`/api/v1/ldap/config?organizationId=${organizationId}`
|
||||
);
|
||||
|
||||
return data;
|
||||
return data;
|
||||
} catch (err) {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
enabled: true
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user