Fix: Transform empty object to array without opening 'editNode' modal to prevent flow build breakage.
This commit is contained in:
parent
921e34e378
commit
2ca2fc0f6a
1 changed files with 4 additions and 0 deletions
|
|
@ -474,6 +474,8 @@ export function convertArrayToObj(arrayOfObjects) {
|
|||
|
||||
export function hasDuplicateKeys(array) {
|
||||
const keys = {};
|
||||
// Transforms an empty object into an object array without opening the 'editNode' modal to prevent the flow build from breaking.
|
||||
if (!Array.isArray(array)) array = [{"": ""}];
|
||||
for (const obj of array) {
|
||||
for (const key in obj) {
|
||||
if (keys[key]) {
|
||||
|
|
@ -486,6 +488,8 @@ export function hasDuplicateKeys(array) {
|
|||
}
|
||||
|
||||
export function hasEmptyKey(objArray) {
|
||||
// Transforms an empty object into an array without opening the 'editNode' modal to prevent the flow build from breaking.
|
||||
if (!Array.isArray(objArray)) objArray = [];
|
||||
for (const obj of objArray) {
|
||||
for (const key in obj) {
|
||||
if (obj.hasOwnProperty(key) && key === "") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue