zhangzf преди 1 ден
родител
ревизия
20eed98bef
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4 2
      src/components/layout/navbar/index.tsx

+ 4 - 2
src/components/layout/navbar/index.tsx

@@ -9,7 +9,9 @@ import { NavigationSkeleton } from "./NavigationSkeleton";
 import { ActionsSkeleton } from "./ActionsSkeleton";
 import { NavbarErrorBoundary } from "@/components/error/ErrorBoundary";
 
-// import { GET_TREE_CATEGORIES,GET_TREEFRONT_MENUS } from "@/graphql";
+import { 
+  // GET_TREE_CATEGORIES,
+  GET_TREEFRONT_MENUS } from "@/graphql";
 // import { cachedGraphQLRequest } from "@utils/hooks/useCache";
 import { serverGraphqlFetch } from "@utils/bagisto/index";
 // import { TreeCategoriesResponse } from "@/types/theme/category-tree";
@@ -34,7 +36,7 @@ export default async function Navbar() {
   query: GET_TREEFRONT_MENUS,
 });
 console.log('GetTreefrontMenusResult --- ',menudata)
-  const menudatas = menudata.treefrontMenus;
+  const menudatas =menudata? menudata.treefrontMenus:[];
   // const filteredCategories = categories
   //   .filter((cat: any) => cat.id !== "1")
   //   .map((cat: any) => {