summaryrefslogtreecommitdiff
path: root/app/api/auth
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-11-10 17:57:27 +0900
committerjoonhoekim <26rote@gmail.com>2025-11-10 17:57:27 +0900
commit64b16282fea10ed94dc1c4f1b81703c4875d9f7e (patch)
tree3bfcc0d1c13424b82e3bda5433c92d928f8cf537 /app/api/auth
parenta8ea14922ded4589005ef44164e25d07409ec215 (diff)
(김준회) taxId 필수값에서 제거 (MDG에서 사업자번호(세금번호) 없는 벤더가 들어오기 때문)
Diffstat (limited to 'app/api/auth')
-rw-r--r--app/api/auth/signup-with-vendor/route.ts25
1 files changed, 14 insertions, 11 deletions
diff --git a/app/api/auth/signup-with-vendor/route.ts b/app/api/auth/signup-with-vendor/route.ts
index 4585778c..f8c2c6ee 100644
--- a/app/api/auth/signup-with-vendor/route.ts
+++ b/app/api/auth/signup-with-vendor/route.ts
@@ -408,17 +408,20 @@ export async function POST(request: NextRequest) {
)
}
- const existingVendor = await db
- .select({ id: vendors.id })
- .from(vendors)
- .where(eq(vendors.taxId, vendor.taxId))
- .limit(1)
-
- if (existingVendor.length > 0) {
- return NextResponse.json(
- { error: '이미 등록된 사업자등록번호입니다.' },
- { status: 400 }
- )
+ // Check for existing taxId (only if taxId is provided)
+ if (vendor.taxId && vendor.taxId.trim()) {
+ const existingVendor = await db
+ .select({ id: vendors.id })
+ .from(vendors)
+ .where(eq(vendors.taxId, vendor.taxId))
+ .limit(1)
+
+ if (existingVendor.length > 0) {
+ return NextResponse.json(
+ { error: '이미 등록된 사업자등록번호입니다.' },
+ { status: 400 }
+ )
+ }
}
// 클라이언트 정보 추출