주문건에 대한 배송 수정은 현재 배송상태/택배회사/송장번호 가 대표적이다
이 때 3가지 input 중 1가지만 변경하려 할때
<button className="fixButton" onClick={()=>{onFixOrder(o)}}>fix</button>
//주문건 수정
const onFixOrder =(o)=>{
console.log(orderStatue.orderStatus);
if(orderStatue.orderStatus==='' && orderStatue.shipCode===''){
setOrderStatue({
...orderStatue,
orderStatus: o.orderStatus,
shipCode: o.shipCode
})
} else if(orderStatue.orderStatus==='' && orderStatue.shipCompany===''){
setOrderStatue({
...orderStatue,
orderStatus: o.orderStatus,
shipCompany: o.shipCompany
})
} else if(orderStatue.shipCode==='' && orderStatue.shipCompany===''){
setOrderStatue({
...orderStatue,
shipCode: o.shipCode,
shipCompany: o.shipCompany
})
} else if(orderStatue.orderStatus===''){
setOrderStatue({
...orderStatue,
orderStatus: o.orderStatus
})
} else if(orderStatue.shipCode===''){
setOrderStatue({
...orderStatue,
shipCode: o.shipCode
})
} else if(orderStatue.shipCompany===''){
setOrderStatue({
...orderStatue,
shipCompany: o.shipCompany
})
}
console.log(orderStatue);
}
무식하게 넣어주자 일단