diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-11-24 05:00:38 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-11-24 05:00:38 +0000 |
| commit | d79f56ae5a9e5f72781f78fe0399018cfac44081 (patch) | |
| tree | 7a4aaaba1e27e6aa7ac19bd72909989ae804d7e8 /lib/techsales-rfq/service.ts | |
| parent | 58d700b925967bfe470c944b380b02b2140cab8a (diff) | |
(최겸) 기술영업 결재 수정
Diffstat (limited to 'lib/techsales-rfq/service.ts')
| -rw-r--r-- | lib/techsales-rfq/service.ts | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/lib/techsales-rfq/service.ts b/lib/techsales-rfq/service.ts index ed3472b1..6f2d7914 100644 --- a/lib/techsales-rfq/service.ts +++ b/lib/techsales-rfq/service.ts @@ -551,19 +551,15 @@ export async function sendTechSalesRfqToVendors(input: { contactEmail: string;
contactName: string;
}>;
+ currentUser: {
+ id: string | number;
+ name?: string | null;
+ email?: string | null;
+ epId?: string | null;
+ };
}) {
unstable_noStore();
try {
- // 인증 확인
- const session = await getServerSession(authOptions);
-
- if (!session?.user) {
- return {
- success: false,
- message: "인증이 필요합니다",
- };
- }
-
// RFQ 정보 조회
const rfq = await db.query.techSalesRfqs.findFirst({
where: eq(techSalesRfqs.id, input.rfqId),
@@ -611,7 +607,7 @@ export async function sendTechSalesRfqToVendors(input: { // 현재 사용자 정보 조회
const sender = await db.query.users.findFirst({
- where: eq(users.id, Number(session.user.id)),
+ where: eq(users.id, Number(input.currentUser.id)),
columns: {
id: true,
email: true,
@@ -661,8 +657,8 @@ export async function sendTechSalesRfqToVendors(input: { // 1. RFQ 상태 업데이트 (최초 발송인 경우 rfqSendDate 설정)
const updateData: Partial<typeof techSalesRfqs.$inferInsert> = {
status: TECH_SALES_RFQ_STATUSES.RFQ_SENT,
- sentBy: Number(session.user.id),
- updatedBy: Number(session.user.id),
+ sentBy: Number(input.currentUser.id),
+ updatedBy: Number(input.currentUser.id),
updatedAt: new Date(),
};
@@ -681,7 +677,7 @@ export async function sendTechSalesRfqToVendors(input: { await tx.update(techSalesVendorQuotations)
.set({
status: "Draft",
- updatedBy: Number(session.user.id),
+ updatedBy: Number(input.currentUser.id),
updatedAt: new Date(),
})
.where(eq(techSalesVendorQuotations.id, quotation.id));
|
