mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 19:28:35 +00:00
Continue progress on role ui update
This commit is contained in:
@@ -94,10 +94,13 @@ export const useGetOrgRole = (orgId: string, roleId: string) =>
|
||||
useQuery({
|
||||
queryKey: roleQueryKeys.getOrgRole(orgId, roleId),
|
||||
queryFn: async () => {
|
||||
const { data } = await apiRequest.get<{ role: TProjectRole }>(
|
||||
`/api/v1/organization/${orgId}/roles/${roleId}` // TODO: implement
|
||||
);
|
||||
return data.role;
|
||||
const { data } = await apiRequest.get<{
|
||||
role: Omit<TOrgRole, "permissions"> & { permissions: unknown };
|
||||
}>(`/api/v1/organization/${orgId}/roles/${roleId}`);
|
||||
return {
|
||||
...data.role,
|
||||
permissions: unpackRules(data.role.permissions as PackRule<TPermission>[])
|
||||
};
|
||||
},
|
||||
enabled: Boolean(orgId && roleId)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user