From ef4c533ebacc2cdc97e518f30e9a9350004fcdfb Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 28 Apr 2025 02:13:30 +0000
Subject: ~20250428 작업사항
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/vendors/table/request-vendor-pg-dialog.tsx | 11 +++++++++++
 1 file changed, 11 insertions(+)

(limited to 'lib/vendors/table/request-vendor-pg-dialog.tsx')

diff --git a/lib/vendors/table/request-vendor-pg-dialog.tsx b/lib/vendors/table/request-vendor-pg-dialog.tsx
index de23ad9b..4bc4e909 100644
--- a/lib/vendors/table/request-vendor-pg-dialog.tsx
+++ b/lib/vendors/table/request-vendor-pg-dialog.tsx
@@ -29,6 +29,7 @@ import {
 } from "@/components/ui/drawer"
 import { Vendor } from "@/db/schema/vendors"
 import { requestPQVendors } from "../service"
+import { useSession } from "next-auth/react"
 
 interface ApprovalVendorDialogProps
   extends React.ComponentPropsWithoutRef<typeof Dialog> {
@@ -45,11 +46,21 @@ export function RequestPQVendorsDialog({
 }: ApprovalVendorDialogProps) {
   const [isApprovePending, startApproveTransition] = React.useTransition()
   const isDesktop = useMediaQuery("(min-width: 640px)")
+  const { data: session } = useSession()
 
   function onApprove() {
+
+    if (!session?.user?.id) {
+      toast.error("사용자 인증 정보를 찾을 수 없습니다.")
+      return
+    }
+
+
     startApproveTransition(async () => {
       const { error } = await requestPQVendors({
         ids: vendors.map((vendor) => vendor.id),
+        userId: Number(session.user.id) 
+
       })
 
       if (error) {
-- 
cgit v1.2.3

