diff options
Diffstat (limited to 'lib/vendor-document-list/enhanced-document-service.ts')
| -rw-r--r-- | lib/vendor-document-list/enhanced-document-service.ts | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/lib/vendor-document-list/enhanced-document-service.ts b/lib/vendor-document-list/enhanced-document-service.ts index 00f40ea6..d39dfaa4 100644 --- a/lib/vendor-document-list/enhanced-document-service.ts +++ b/lib/vendor-document-list/enhanced-document-service.ts @@ -86,8 +86,8 @@ export async function getEnhancedDocuments( input: GetEnhancedDocumentsSchema, contractId: number ) { - return unstable_cache( - async () => { + // return unstable_cache( + // async () => { try { const offset = (input.page - 1) * input.perPage @@ -140,6 +140,8 @@ export async function getEnhancedDocuments( return { data, total } }) + console.log(data) + const pageCount = Math.ceil(total / input.perPage) return { data, pageCount, total } @@ -147,19 +149,19 @@ export async function getEnhancedDocuments( console.error("Error fetching enhanced documents:", err) return { data: [], pageCount: 0, total: 0 } } - }, - [JSON.stringify(input), String(contractId)], - { - revalidate: 3600, - tags: [`enhanced-documents-${contractId}`], - } - )() + // }, + // [JSON.stringify(input), String(contractId)], + // { + // revalidate: 3600, + // tags: [`enhanced-documents-${contractId}`], + // } + // )() } // 통계 데이터 가져오기 export async function getDocumentStatistics(contractId: number) { - return unstable_cache( - async () => { + // return unstable_cache( + // async () => { try { const result = await db .select({ @@ -229,13 +231,13 @@ export async function getDocumentStatistics(contractId: number) { avgProgress: 0, } } - }, - [`document-stats-${contractId}`], - { - revalidate: 1800, // 30분 캐시 - tags: [`document-stats-${contractId}`], - } - )() + // }, + // [`document-stats-${contractId}`], + // { + // revalidate: 1800, // 30분 캐시 + // tags: [`document-stats-${contractId}`], + // } + // )() } // 빠른 필터 데이터 |
