mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-18 22:29:15 +00:00
feat: removed last bit of workspace in frontend. Fatality!
This commit is contained in:
@@ -22,8 +22,8 @@ export const useProjectPermission = () => {
|
||||
const {
|
||||
data: { permission, membership, assumedPrivilegeDetails }
|
||||
} = useSuspenseQuery({
|
||||
queryKey: roleQueryKeys.getUserProjectPermissions({ workspaceId: projectId }),
|
||||
queryFn: () => fetchUserProjectPermissions({ workspaceId: projectId }),
|
||||
queryKey: roleQueryKeys.getUserProjectPermissions({ projectId }),
|
||||
queryFn: () => fetchUserProjectPermissions({ projectId }),
|
||||
staleTime: Infinity,
|
||||
select: (data) => {
|
||||
const rule = unpackRules<RawRuleOf<MongoAbility<ProjectPermissionSet>>>(data.permissions);
|
||||
|
||||
@@ -2,9 +2,9 @@ import { useSuspenseQuery } from "@tanstack/react-query";
|
||||
import { useParams } from "@tanstack/react-router";
|
||||
|
||||
import { projectKeys } from "@app/hooks/api";
|
||||
import { fetchWorkspaceById } from "@app/hooks/api/workspace/queries";
|
||||
import { fetchProjectById } from "@app/hooks/api/projects/queries";
|
||||
|
||||
export const useWorkspace = () => {
|
||||
export const useProject = () => {
|
||||
const params = useParams({
|
||||
strict: false
|
||||
});
|
||||
@@ -12,11 +12,11 @@ export const useWorkspace = () => {
|
||||
throw new Error("Missing project id");
|
||||
}
|
||||
|
||||
const { data: currentWorkspace } = useSuspenseQuery({
|
||||
queryKey: projectKeys.getWorkspaceById(params.projectId),
|
||||
queryFn: () => fetchWorkspaceById(params.projectId as string),
|
||||
const { data: currentProject } = useSuspenseQuery({
|
||||
queryKey: projectKeys.getProjectById(params.projectId),
|
||||
queryFn: () => fetchProjectById(params.projectId as string),
|
||||
staleTime: Infinity
|
||||
});
|
||||
|
||||
return { currentWorkspace };
|
||||
return { currentProject, projectId: currentProject.id };
|
||||
};
|
||||
|
||||
@@ -1 +1 @@
|
||||
export { useWorkspace } from "./WorkspaceContext";
|
||||
export { useProject } from "./WorkspaceContext";
|
||||
|
||||
@@ -29,4 +29,4 @@ export {
|
||||
export { useServerConfig } from "./ServerConfigContext";
|
||||
export { useSubscription } from "./SubscriptionContext";
|
||||
export { useUser } from "./UserContext";
|
||||
export { useWorkspace } from "./WorkspaceContext";
|
||||
export { useProject } from "./WorkspaceContext";
|
||||
|
||||
Reference in New Issue
Block a user