From 92eda21e45d902663052575aaa4c4f80bfa2faea Mon Sep 17 00:00:00 2001 From: dujinkim Date: Mon, 4 Aug 2025 09:36:14 +0000 Subject: (대표님) 벤더 문서 변경사항, data-table 변경, sync 변경 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/vendor-document-list/service.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/vendor-document-list/service.ts') diff --git a/lib/vendor-document-list/service.ts b/lib/vendor-document-list/service.ts index de6f0488..76bdac49 100644 --- a/lib/vendor-document-list/service.ts +++ b/lib/vendor-document-list/service.ts @@ -308,4 +308,19 @@ export async function getContractIdsByVendor(vendorId: number): Promise { + try { + const contractsData = await db + .selectDistinct({ projectId: contracts.projectId }) + .from(contracts) + .where(eq(contracts.vendorId, vendorId)) + .orderBy(contracts.projectId) // projectId로 정렬하는 것이 더 의미있을 수 있음 + + return contractsData.map(contract => contract.projectId) + } catch (error) { + console.error('Error fetching contract IDs by vendor:', error) + return [] + } } \ No newline at end of file -- cgit v1.2.3