搜索框: 不删除空字段

feature/price_manager
Lei OT 1 year ago
parent b568379f41
commit 66c7ba9574

@ -27,7 +27,7 @@ const SearchForm = ({ initialValue, onSubmit, onReset, ...props }) => {
const formValuesMapper = (values) => {
const destinationObject = {
'referenceNo': { key: 'referenceNo' },
'referenceNo': { key: 'referenceNo', transform: (value) => value || '' },
'dates': [
{ key: 'startdate', transform: (arrVal) => (arrVal ? arrVal[0].format(DATE_FORMAT) : '') },
{ key: 'enddate', transform: (arrVal) => (arrVal ? arrVal[1].format(DATE_FORMAT) : '') },
@ -45,7 +45,7 @@ const SearchForm = ({ initialValue, onSubmit, onReset, ...props }) => {
}
}
// omit empty
Object.keys(dest).forEach((key) => (dest[key] == null || dest[key] === '' || dest[key].length === 0) && delete dest[key]);
// Object.keys(dest).forEach((key) => (dest[key] == null || dest[key] === '' || dest[key].length === 0) && delete dest[key]);
return dest;
};

Loading…
Cancel
Save