mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
refactor: Consolidate project ID retrieval in PolicySelectionModal and RolePermissionsSection for improved clarity and consistency
This commit is contained in:
@@ -47,9 +47,9 @@ type TForm = { permissions: Record<ProjectPermissionSub, boolean> };
|
||||
const Content = ({ onClose, type: projectType }: ContentProps) => {
|
||||
const rootForm = useFormContext<TFormSchema>();
|
||||
const [search, setSearch] = useState("");
|
||||
const { currentProject } = useProject();
|
||||
const { currentProject, projectId } = useProject();
|
||||
const isSecretManagerProject = currentProject.type === ProjectType.SecretManager;
|
||||
const { data: integrations = [] } = useGetWorkspaceIntegrations(currentProject?.id ?? "", {
|
||||
const { data: integrations = [] } = useGetWorkspaceIntegrations(projectId, {
|
||||
enabled: isSecretManagerProject,
|
||||
refetchInterval: false
|
||||
});
|
||||
|
||||
@@ -103,14 +103,11 @@ export const renderConditionalComponents = (
|
||||
};
|
||||
|
||||
export const RolePermissionsSection = ({ roleSlug, isDisabled }: Props) => {
|
||||
const { currentProject } = useProject();
|
||||
const projectId = currentProject?.id || "";
|
||||
const { currentProject, projectId } = useProject();
|
||||
|
||||
const isSecretManagerProject = currentProject.type === ProjectType.SecretManager;
|
||||
|
||||
const { data: role, isPending } = useGetProjectRoleBySlug(
|
||||
currentProject?.id ?? "",
|
||||
roleSlug as string
|
||||
);
|
||||
const { data: role, isPending } = useGetProjectRoleBySlug(projectId, roleSlug as string);
|
||||
const { data: integrations = [] } = useGetWorkspaceIntegrations(projectId, {
|
||||
enabled: isSecretManagerProject,
|
||||
refetchInterval: false
|
||||
|
||||
Reference in New Issue
Block a user