mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 05:13:43 +00:00
feature: scim group org role mapping
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
||||
|
||||
import { apiRequest } from "@app/config/request";
|
||||
import { TExternalGroupOrgRoleMappingList } from "@app/hooks/api/externalGroupOrgRoleMappings/types";
|
||||
|
||||
export const externalGroupOrgRoleMappingKeys = {
|
||||
all: ["external-group-org-role-mapping"] as const,
|
||||
list: () => [...externalGroupOrgRoleMappingKeys.all, "list"] as const
|
||||
};
|
||||
|
||||
export const useGetExternalGroupOrgRoleMappings = (
|
||||
options?: Omit<
|
||||
UseQueryOptions<
|
||||
TExternalGroupOrgRoleMappingList,
|
||||
unknown,
|
||||
TExternalGroupOrgRoleMappingList,
|
||||
ReturnType<typeof externalGroupOrgRoleMappingKeys.list>
|
||||
>,
|
||||
"queryKey" | "queryFn"
|
||||
>
|
||||
) => {
|
||||
return useQuery({
|
||||
queryKey: externalGroupOrgRoleMappingKeys.list(),
|
||||
queryFn: async () => {
|
||||
const { data } = await apiRequest.get<TExternalGroupOrgRoleMappingList>(
|
||||
"/api/v1/external-group-mappings"
|
||||
);
|
||||
|
||||
return data;
|
||||
},
|
||||
...options
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user