diff options
Diffstat (limited to 'app/api/auth/signup-with-vendor/route.ts')
| -rw-r--r-- | app/api/auth/signup-with-vendor/route.ts | 25 |
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 } + ) + } } // 클라이언트 정보 추출 |
