feat(infisical-pg): changed frontend api types _id to normal id

This commit is contained in:
Akhil Mohan
2024-01-27 12:38:22 +05:30
parent f3b37de3f3
commit aaba4a0895
161 changed files with 5358 additions and 4510 deletions
@@ -22,7 +22,7 @@ export const OrgPermissionProvider = ({ children }: Props): JSX.Element => {
if (isLoading) {
return (
<div className="flex items-center justify-center w-screen h-screen bg-bunker-800">
<div className="flex h-screen w-screen items-center justify-center bg-bunker-800">
<img
src="/images/loading/loading.gif"
height={70}
@@ -35,7 +35,7 @@ export const OrgPermissionProvider = ({ children }: Props): JSX.Element => {
if (!permission) {
return (
<div className="flex items-center justify-center w-screen h-screen bg-bunker-800">
<div className="flex h-screen w-screen items-center justify-center bg-bunker-800">
Failed to load user permissions
</div>
);
@@ -3,7 +3,6 @@ import { createContext, ReactNode, useContext, useMemo } from "react";
import { useGetOrganizations } from "@app/hooks/api";
import { Organization } from "@app/hooks/api/types";
type TOrgContext = {
orgs?: Organization[];
currentOrg?: Organization;
@@ -18,7 +17,7 @@ type Props = {
export const OrgProvider = ({ children }: Props): JSX.Element => {
const { data: userOrgs, isLoading } = useGetOrganizations();
// const currentWsOrgID = currentWorkspace?.organization;
const currentWsOrgID = localStorage.getItem("orgData.id");
@@ -18,7 +18,7 @@ export const ProjectPermissionProvider = ({ children }: Props): JSX.Element => {
if ((isLoading && currentWorkspace) || isWsLoading) {
return (
<div className="flex items-center justify-center w-screen h-screen bg-bunker-800">
<div className="flex h-screen w-screen items-center justify-center bg-bunker-800">
<img
src="/images/loading/loading.gif"
height={70}
@@ -31,7 +31,7 @@ export const ProjectPermissionProvider = ({ children }: Props): JSX.Element => {
if (!permission && currentWorkspace) {
return (
<div className="flex items-center justify-center w-screen h-screen bg-bunker-800">
<div className="flex h-screen w-screen items-center justify-center bg-bunker-800">
Failed to load user permissions
</div>
);
@@ -72,9 +72,9 @@ export const ServerConfigProvider = ({ children }: Props): JSX.Element => {
export const useServerConfig = () => {
const ctx = useContext(ServerConfigContext);
// if (!ctx) {
// throw new Error("useServerConfig has to be used within <UserContext.Provider>");
// }
if (!ctx) {
throw new Error("useServerConfig has to be used within <UserContext.Provider>");
}
return ctx || { config: { allowSignUp: true } };
return ctx;
};
@@ -1,10 +1,10 @@
import { createContext, ReactNode, useContext, useMemo } from "react";
import { useGetUser } from "@app/hooks/api";
import { User } from "@app/hooks/api/types";
import { User, UserEnc } from "@app/hooks/api/types";
type TUserContext = {
user: User;
user: User & UserEnc;
isLoading: boolean;
};
@@ -26,7 +26,7 @@ export const WorkspaceProvider = ({ children }: Props): JSX.Element => {
const wsId = workspaceId || localStorage.getItem("projectData.id");
return {
workspaces: ws || [],
currentWorkspace: (ws || []).find(({ id: id }) => id === wsId),
currentWorkspace: (ws || []).find(({ id }) => id === wsId),
isLoading
};
}, [ws, workspaceId, isLoading]);