feat: resolved role issue in ui

This commit is contained in:
=
2024-10-25 00:59:40 +05:30
parent b6a1ab2376
commit 2afc6b133e
6 changed files with 10 additions and 7 deletions
@@ -30,7 +30,7 @@ export const RolePage = withProjectPermission(
const { currentWorkspace } = useWorkspace();
const projectId = currentWorkspace?.id || "";
const { data } = useGetProjectRoleBySlug(currentWorkspace?.slug ?? "", roleSlug as string);
const { data } = useGetProjectRoleBySlug(projectId, roleSlug as string);
const { mutateAsync: deleteProjectRole } = useDeleteProjectRole();
@@ -19,7 +19,7 @@ export const RoleDetailsSection = ({ roleSlug, handlePopUpOpen }: Props) => {
});
const { currentWorkspace } = useWorkspace();
const { data } = useGetProjectRoleBySlug(currentWorkspace?.slug ?? "", roleSlug as string);
const { data } = useGetProjectRoleBySlug(currentWorkspace?.id ?? "", roleSlug as string);
const isCustomRole = !["admin", "member", "viewer", "no-access"].includes(data?.slug ?? "");
@@ -48,7 +48,7 @@ export const RolePermissionsSection = ({ roleSlug, isDisabled }: Props) => {
const { popUp, handlePopUpToggle } = usePopUp(["createPolicy"] as const);
const projectId = currentWorkspace?.id || "";
const { data: role, isLoading } = useGetProjectRoleBySlug(
currentWorkspace?.slug ?? "",
currentWorkspace?.id ?? "",
roleSlug as string
);