fix enum field causing issues when created in modal + changed data empty button text/target

This commit is contained in:
dswbx
2024-11-18 16:42:27 +01:00
parent 95ea2c8919
commit 4fd315da98
4 changed files with 6 additions and 4 deletions

View File

@@ -179,6 +179,7 @@ export function objectDepth(object: object): number {
}
export function objectCleanEmpty<Obj extends { [key: string]: any }>(obj: Obj): Obj {
if (!obj) return obj;
return Object.entries(obj).reduce((acc, [key, value]) => {
if (value && Array.isArray(value) && value.some((v) => typeof v === "object")) {
const nested = value.map(objectCleanEmpty);