refactor: 'SITE_ID' 환경변수 쿠키로 수정

This commit is contained in:
2025-06-30 13:23:29 +09:00
parent 0e9d865f44
commit 9a38ce33c0
6 changed files with 15 additions and 10 deletions
@@ -3,7 +3,6 @@
import { useState, useEffect, useRef } from "react";
import { useQuery } from "@tanstack/react-query";
import { ChevronRight } from "lucide-react";
import { getConfig } from "@common/config";
import { ENDPOINT } from "../../config";
import { cn, setCookie } from "../../lib";
import { getMenuList, type MenuItem } from "../../api";
@@ -24,8 +23,9 @@ import {
CollapsibleTrigger,
} from "../collapsible";
import { getParentIds } from "./lib";
import { getCookie } from "../../lib";
const { SITE_ID } = getConfig();
const siteId = getCookie("site-id-key") ?? "";
export function LNB({
viewOnly,
@@ -38,7 +38,7 @@ export function LNB({
}) {
const { data: menuList } = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.MENU_ROLES],
queryFn: () => getMenuList(SITE_ID ?? ""),
queryFn: () => getMenuList(siteId),
enabled: !viewOnly,
});