Skip to content

Commit

Permalink
63. Json path bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Soumyadas15 committed Mar 10, 2024
1 parent 91c81bb commit 1cb9cd4
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getLocalData } from "@/lib/localData";

const font = Montserrat({ subsets: ["latin"] });

import data from "@/json/avatarConfig.json";
import data from "@/public/json/avatarConfig.json";
import { AvatarStateProvider } from "./context/avatarState";
import { ProfileModal } from "@/components/modals/ProfileModal";
import { initialProfile } from "@/lib/initial-profile";
Expand Down
6 changes: 0 additions & 6 deletions app/main/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,11 @@ import { Navbar } from "@/components/navbar/Navbar";
import { initialProfile } from "@/lib/initial-profile";
import SuccessModal from "@/components/modals/SuccessModal";
import NameModal from "@/components/modals/createModals/NameModal";
import { ProfileModal } from "@/components/modals/ProfileModal";
import { EmployeesModal } from "@/components/modals/EmployeesModal";
import { getAuditors, getClients, getManagers } from "@/actions/getUsers/getUserByEmail";
import { SocketProvider } from "@/providers/SocketProvider";
import getNotifications from "@/actions/getNotifications/getNotificationByUserId";
import getUnreadNotifications from "@/actions/getNotifications/getUnreadNotifications";
import { getLocalData } from "@/lib/localData";

import data from "@/json/avatarConfig.json";
import { AvatarStateProvider } from "../context/avatarState";
import { MainComponent } from "@/components/avatarCreator/MainComponent";



Expand Down
4 changes: 2 additions & 2 deletions lib/localData.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import fsPromises from "fs/promises";
import path from "path";

import data from "@/json/avatarConfig.json";
import data from "@/public/json/avatarConfig.json";
export type JSONType = typeof data;

export async function getLocalData() {
// Get the path of the json file
const filePath = path.join(process.cwd(), "json/avatarConfig.json");
const filePath = path.join(process.cwd(), "/public/json/avatarConfig.json");
// Read the json file
const jsonData = await fsPromises.readFile(filePath) as unknown as string;
// Parse data as json
Expand Down
File renamed without changes.

0 comments on commit 1cb9cd4

Please sign in to comment.