From d596e41d4dc1810cc1bb59da85435199606b220c Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Fri, 31 Mar 2023 18:30:39 +0530 Subject: [PATCH] fix: project setting control fix (#658) * fix: project setting control fix * fix: project member endpoint fix --- .../projects/[projectId]/settings/control.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/control.tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/control.tsx index 5151a2a9f..7491e09f0 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/control.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/control.tsx @@ -12,7 +12,6 @@ import { requiredAdmin } from "lib/auth"; import AppLayout from "layouts/app-layout"; // services import projectService from "services/project.service"; -import workspaceService from "services/workspace.service"; // hooks import useToast from "hooks/use-toast"; // ui @@ -22,7 +21,7 @@ import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs"; import { IProject, IWorkspace } from "types"; import type { NextPage, GetServerSidePropsContext } from "next"; // fetch-keys -import { PROJECTS_LIST, PROJECT_DETAILS, WORKSPACE_MEMBERS } from "constants/fetch-keys"; +import { PROJECTS_LIST, PROJECT_DETAILS, PROJECT_MEMBERS } from "constants/fetch-keys"; type TControlSettingsProps = { isMember: boolean; @@ -53,8 +52,10 @@ const ControlSettings: NextPage = (props) => { ); const { data: people } = useSWR( - workspaceSlug ? WORKSPACE_MEMBERS : null, - workspaceSlug ? () => workspaceService.workspaceMembers(workspaceSlug as string) : null + workspaceSlug && projectId ? PROJECT_MEMBERS(projectId as string) : null, + workspaceSlug && projectId + ? () => projectService.projectMembers(workspaceSlug as string, projectId as string) + : null ); const { @@ -101,7 +102,6 @@ const ControlSettings: NextPage = (props) => { console.log(err); }); }; - return ( = (props) => { > {people?.map((person) => ( @@ -200,7 +200,7 @@ const ControlSettings: NextPage = (props) => { > {people?.map((person) => (