하단 배열이 들어오고, 버튼을 눌렀을때 products 배열의 count 를 + 1 해주고 싶은데 아무리 고민해보고 이리저리 해봐도 배열 업데이트 하는 방법을 모르겠습니다.. 고수님들 도와주세요
export const CART_HISTORY = [
{
cartId: '1',
seller: {
sellerId: '3',
name: '미미',
thumbnail:
'https://dimg.donga.com/ugc/CDB/WEEKLY/Article/5f/22/2d/58/5f222d580749d2738de6.jpg',
},
products: [
{
id: '1',
brand_name: 'CITY BOY',
description: '코튼 와이드 팬츠',
image:
'https://image.msscdn.net/images/goods_img/20201014/1648073/1648073_3_500.jpg',
option: '옵션: 코튼 와이드 팬츠 / XS ',
count: '1',
price: '90,000원',
ship_price: '3,000원',
member_price: '- 45,000원',
},
{
id: '2',
brand_name: 'CITY 패딩',
description: '따뜻한 패딩',
image:
'https://image.msscdn.net/images/goods_img/20220708/2653637/2653637_3_500.jpg',
option: '옵션: 코튼 와이드 패딩2 / XS ',
count: '2',
ship_price: '3,000원',
price: '50,000원',
member_price: '- 25,000원',
},
],
ship_price: '3,000원',
total_price: '140,000원',
},
{
cartId: '2',
seller: {
sellerId: '5',
name: '동석',
thumbnail:
'https://img.hankyung.com/photo/201811/01.18271154.1.jpg',
},
products: [
{
id: '3',
brand_name: 'nike',
description: 'nike 반바지',
image:
'https://image.msscdn.net/images/prd_img/20190404/1005314/detail_1005314_1_500.jpg?t=20190404152622',
option: '옵션: 반바지 / XL ',
count: '4',
ship_price: '3,000원',
price: '20,000원',
member_price: '- 10,000원',
},
],
ship_price: '3,000원',
total_price: '20,000원',
},
];