|
|
|
@ -61,7 +61,7 @@ const ProductInfo = ({ ...props }) => {
|
|
|
|
|
|
|
|
|
|
const onValuesChange = (changedValues) => {
|
|
|
|
|
// console.log('onValuesChange', changedValues);
|
|
|
|
|
const changedKeys = objectMapper(changedValues, { 'city': 'city_id', 'dept': 'dept_id', 'product_title': 'title'});
|
|
|
|
|
const changedKeys = objectMapper(changedValues, { 'city': 'city_id', 'dept': 'dept_id', 'product_title': 'title', 'lgc_details_mapped': 'lgc_details'});
|
|
|
|
|
setEditKeys(prev => unique([...prev, ...Object.keys(changedKeys)]));
|
|
|
|
|
// const preValues = pick(editingProduct.info, editKeys);
|
|
|
|
|
if ('product_title' in changedValues) {
|
|
|
|
@ -79,7 +79,8 @@ const ProductInfo = ({ ...props }) => {
|
|
|
|
|
const onSave = async (err, values, forms) => {
|
|
|
|
|
values.travel_agency_id = activeAgency.travel_agency_id;
|
|
|
|
|
const editChanged = pick(editingProduct.info, editKeys);
|
|
|
|
|
// console.log("editKeys pre values", editKeys, editChanged);
|
|
|
|
|
(editKeys.includes('lgc_details') ? editChanged.lgc_details = editingProduct.lgc_details.map(l => l.lgc) : false);
|
|
|
|
|
// console.log("editKeys pre values", editKeys, editChanged, '\neditingProduct', );
|
|
|
|
|
|
|
|
|
|
const copyNewProduct = structuredClone(newProductRecord);
|
|
|
|
|
const poster = {
|
|
|
|
|