fix(admin): 견적 재발송 방어 + title 타입 검증

- POST /api/admin/quotes: title을 typeof + trim() 검증으로 falsy 문자열 방어
- POST /api/admin/quotes/[id]/send: sent/accepted/rejected 상태면 200 조기 반환(alreadySent: true)으로 중복 발송 차단
- 견적 편집 UI: isSentStatus 플래그로 발송 버튼 비활성화·라벨 "발송됨" 표시, alreadySent 응답 시 안내 alert 처리

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 05:28:22 +09:00
parent 70abad31b7
commit 5ceae7e90b
3 changed files with 27 additions and 11 deletions

View File

@@ -36,7 +36,7 @@ export async function POST(request: Request) {
// 의뢰(contact_requests) 연결용 필드 — string만 허용
const insertData: Record<string, unknown> = {
title: body.title || '새 견적서',
title: typeof body.title === 'string' && body.title.trim() ? body.title : '새 견적서',
client_name: typeof body.client_name === 'string' ? body.client_name : '',
client_email: typeof body.client_email === 'string' ? body.client_email : '',
valid_until: body.valid_until || null,