fix(ecommerce): 장바구니 담기·바로구매 옵션 식별을 product_option_id 기반으로 전환
담기/바로구매가 메인 옵션을 로케일 값 조합(option_values)으로 전송하고 서버가 문자열 동등비교로 역매칭하던 방식은, 클라·서버 로케일 불일치나 관리자의 옵션 값 텍스트 수정 시 매칭 실패를 유발했다. 클라이언트가 이미 보유한 옵션 ID(optionId)를 전송하고, 서버는 요청 상품의 옵션 집합 내에서 ID로만 조회하도록 전환한다. 추가옵션(value_id/custom_text)은 이미 ID 기반이라 변경 없음.
This commit is contained in:
1 parent
8522245137
commit
0cdb97862f
21 files changed
+187
-46
No files matched your search
+2
-1
@@ -34,7 +34,8 @@ class BulkAddToCartRequest extends FormRequest
|
||||
$rules = [
|
||||
'product_id' => ['required', 'integer', Rule::exists(Product::class, 'id')],
|
||||
'items' => 'required|array|min:1',
|
||||
'items.*.option_values' => 'nullable|array',
|
||||
// 메인 옵션 식별자 (옵션 ID 기반). 옵션 없는 상품은 미전송 → 서버가 기본 옵션 자동 해석
|
||||
'items.*.product_option_id' => ['nullable', 'integer'],
|
||||
'items.*.quantity' => 'required|integer|min:1|max:9999',
|
||||
// 추가옵션 선택 (서버에서 value_id 기준 가격 재조회·검증 — 클라 가격 신뢰 금지)
|
||||
'items.*.additional_option_selections' => 'nullable|array',
|
||||
|
||||
Reference in new issue
Block a user