refactor: 'SITE_ID' 환경변수 쿠키로 수정
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user