From 02b1cf005cf3e1df64183d20ba42930eb2767a9f Mon Sep 17 00:00:00 2001 From: dujinkim Date: Thu, 21 Aug 2025 06:57:36 +0000 Subject: (대표님, 최겸) 설계메뉴추가, 작업사항 업데이트 설계메뉴 - 문서관리 설계메뉴 - 벤더 데이터 gtc 메뉴 업데이트 정보시스템 - 메뉴리스트 및 정보 업데이트 파일 라우트 업데이트 엑셀임포트 개선 기본계약 개선 벤더 가입과정 변경 및 개선 벤더 기본정보 - pq 돌체 오류 수정 및 개선 벤더 로그인 과정 이메일 오류 수정 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/notice/service.ts | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) (limited to 'lib/notice') diff --git a/lib/notice/service.ts b/lib/notice/service.ts index 24b03fe9..c261cd2e 100644 --- a/lib/notice/service.ts +++ b/lib/notice/service.ts @@ -6,7 +6,7 @@ import { unstable_cache } from "@/lib/unstable-cache" import { filterColumns } from "@/lib/filter-columns" import { asc, desc, ilike, and, or, eq } from "drizzle-orm" import db from "@/db/db" -import { notice, pageInformation } from "@/db/schema" +import { notice, pageInformation, menuAssignments } from "@/db/schema" import type { CreateNoticeSchema, @@ -321,4 +321,47 @@ export async function getPagePathList(): Promise item.pagePath)); + + let processedCount = 0; + const missingPaths = []; + + // 각 메뉴 항목에 대해 확인 + for (const menu of menuItems) { + if (!existingPaths.has(menu.menuPath)) { + missingPaths.push({ + pagePath: menu.menuPath, + pageName: menu.menuTitle + }); + } + processedCount++; + } + + revalidateTag("notice"); + + return { + success: true, + message: `공지사항 경로 동기화 확인 완료: ${processedCount}개 확인, ${missingPaths.length}개 누락`, + missingPaths: missingPaths + }; + } catch (error) { + console.error("Notice 동기화 오류:", error); + return { + success: false, + message: "공지사항 경로 동기화 중 오류가 발생했습니다.", + missingPaths: [] + }; + } } \ No newline at end of file -- cgit v1.2.3