feat(auth): add user and role management
This commit is contained in:
17
packages/web/src/hooks/useRoles.ee.ts
Normal file
17
packages/web/src/hooks/useRoles.ee.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { useQuery } from '@apollo/client';
|
||||
import { IRole } from '@automatisch/types';
|
||||
|
||||
import { GET_ROLES } from 'graphql/queries/get-roles.ee';
|
||||
|
||||
type QueryResponse = {
|
||||
getRoles: IRole[];
|
||||
}
|
||||
|
||||
export default function useRoles() {
|
||||
const { data, loading } = useQuery<QueryResponse>(GET_ROLES, { context: { autoSnackbar: false } });
|
||||
|
||||
return {
|
||||
roles: data?.getRoles || [],
|
||||
loading
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user