feat: fix item form in edit mode.

This commit is contained in:
Ahmed Bouhuolia
2020-11-10 17:41:53 +02:00
parent b2fd2e7cdb
commit 93fbe1fc98
6 changed files with 159 additions and 116 deletions

View File

@@ -277,4 +277,11 @@ export const itemsStartWith = (items, char) => {
export const saveInvoke = (func, ...rest) => {
return func && func(...rest);
}
export const transformToForm = (obj, emptyInitialValues) => {
return _.pickBy(
obj,
(val, key) => val !== null && Object.keys(emptyInitialValues).includes(key),
)
}