mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-20 19:02:03 +00:00
feat: renamed all from depreciated to deprecated and adjust workspace
context file name as well
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { useSuspenseQuery } from "@tanstack/react-query";
|
||||
import { useParams } from "@tanstack/react-router";
|
||||
|
||||
import { projectKeys } from "@app/hooks/api";
|
||||
import { fetchProjectById } from "@app/hooks/api/projects/queries";
|
||||
|
||||
export const useProject = () => {
|
||||
const params = useParams({
|
||||
strict: false
|
||||
});
|
||||
if (!params.projectId) {
|
||||
throw new Error("Missing project id");
|
||||
}
|
||||
|
||||
const { data: currentProject } = useSuspenseQuery({
|
||||
queryKey: projectKeys.getProjectById(params.projectId),
|
||||
queryFn: () => fetchProjectById(params.projectId as string),
|
||||
staleTime: Infinity
|
||||
});
|
||||
|
||||
return { currentProject, projectId: currentProject.id };
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
export { useProject } from "./ProjectContext";
|
||||
Reference in New Issue
Block a user