external-user-group.ts 434 B

12345678910111213
  1. import useSWR, { SWRResponse } from 'swr';
  2. import { apiv3Get } from '~/client/util/apiv3-client';
  3. import { LDAPGroupSyncSettings } from '~/interfaces/external-user-group';
  4. export const useSWRxLDAPGroupSyncSettings = (): SWRResponse<LDAPGroupSyncSettings, Error> => {
  5. return useSWR(
  6. '/external-user-groups/ldap/sync-settings',
  7. endpoint => apiv3Get(endpoint).then((response) => {
  8. return response.data;
  9. }),
  10. );
  11. };