Skip to content
Snippets Groups Projects
Unverified Commit 677a8715 authored by Daniel Hougaard's avatar Daniel Hougaard Committed by GitHub
Browse files

Merge pull request #2474 from meetcshah19/meet/fix-group-fetch

fix: group fetch using project id
parents dafb89d1 2469c8d0
No related merge requests found
......@@ -103,7 +103,7 @@ export const ApprovalPolicyList = ({ workspaceId }: IProps) => {
const { currentWorkspace } = useWorkspace();
const { data: members } = useGetWorkspaceUsers(workspaceId, true);
const { data: groups } = useListWorkspaceGroups(currentWorkspace?.slug || "");
const { data: groups } = useListWorkspaceGroups(currentWorkspace?.id || "");
const { policies, isLoading: isPoliciesLoading } = useApprovalPolicies(
permission,
......@@ -270,6 +270,7 @@ export const ApprovalPolicyList = ({ workspaceId }: IProps) => {
</Table>
</TableContainer>
<AccessPolicyForm
projectId={currentWorkspace?.id!}
projectSlug={currentWorkspace?.slug!}
isOpen={popUp.policyForm.isOpen}
onToggle={(isOpen) => handlePopUpToggle("policyForm", isOpen)}
......
......@@ -35,6 +35,7 @@ type Props = {
isOpen?: boolean;
onToggle: (isOpen: boolean) => void;
members?: TWorkspaceUser[];
projectId: string;
projectSlug: string;
editValues?: TAccessApprovalPolicy;
};
......@@ -60,6 +61,7 @@ export const AccessPolicyForm = ({
isOpen,
onToggle,
members = [],
projectId,
projectSlug,
editValues
}: Props) => {
......@@ -81,7 +83,7 @@ export const AccessPolicyForm = ({
: undefined
});
const { currentWorkspace } = useWorkspace();
const { data: groups } = useListWorkspaceGroups(projectSlug);
const { data: groups } = useListWorkspaceGroups(projectId);
const environments = currentWorkspace?.environments || [];
const isEditMode = Boolean(editValues);
......@@ -99,7 +101,7 @@ export const AccessPolicyForm = ({
const policyName = policyDetails[watch("policyType")]?.name || "Policy";
const handleCreatePolicy = async (data: TFormSchema) => {
if (!projectSlug) return;
if (!projectId) return;
try {
if (data.policyType === PolicyType.ChangePolicy) {
......@@ -128,7 +130,7 @@ export const AccessPolicyForm = ({
};
const handleUpdatePolicy = async (data: TFormSchema) => {
if (!projectSlug) return;
if (!projectId || !projectSlug) return;
if (!editValues?.id) return;
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment