diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-26 09:57:24 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-26 09:57:24 +0000 |
| commit | 8b23b471638a155fd1bfa3a8c853b26d9315b272 (patch) | |
| tree | 47353e9dd342011cb2f1dcd24b09661707a8421b /lib/vendors/repository.ts | |
| parent | d62368d2b68d73da895977e60a18f9b1286b0545 (diff) | |
(대표님) 권한관리, 문서업로드, rfq첨부, SWP문서룰 등
(최겸) 입찰
Diffstat (limited to 'lib/vendors/repository.ts')
| -rw-r--r-- | lib/vendors/repository.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/vendors/repository.ts b/lib/vendors/repository.ts index d2be43ca..5b9b1116 100644 --- a/lib/vendors/repository.ts +++ b/lib/vendors/repository.ts @@ -175,6 +175,26 @@ export const getVendorContactsById = async (id: number): Promise<VendorContact | return contact }; +export const getVendorContactById = async (id: number): Promise<VendorContact | null> => { + const contactsRes = await db.select().from(vendorContacts).where(eq(vendorContacts.id, id)).execute(); + if (contactsRes.length === 0) return null; + + const contact = contactsRes[0]; + return contact +}; + +export async function updateVendorContactById( + tx: PgTransaction<any, any, any>, + id: number, + data: Partial<VendorContact> +) { + return tx + .update(vendorContacts) + .set(data) + .where(eq(vendorContacts.id, id)) + .returning(); +} + export async function selectVendorContacts( tx: PgTransaction<any, any, any>, params: { |
