Skip to content

Commit

Permalink
fix issue on mailbox rules page
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDuprey committed Jan 26, 2025
1 parent ea636c0 commit 2035d56
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/components/CippTable/util-columnsFromAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,21 @@ const mergeKeys = (dataArray) => {
return dataArray.reduce((acc, item) => {
const mergeRecursive = (obj, base = {}) => {
Object.keys(obj).forEach((key) => {
if (typeof obj[key] === "object" && obj[key] !== null && !Array.isArray(obj[key]) && !skipRecursion.includes(key)) {
if (
typeof obj[key] === "object" &&
obj[key] !== null &&
!Array.isArray(obj[key]) &&
!skipRecursion.includes(key)
) {
if (typeof base[key] === "boolean") {
// Skip merging if base[key] is a boolean
return;
}
base[key] = mergeRecursive(obj[key], base[key] || {});
if (typeof base[key] !== "object" || Array.isArray(base[key])) {
// Re-initialize base[key] if it's not an object
base[key] = {};
}
base[key] = mergeRecursive(obj[key], base[key]);
} else if (typeof obj[key] === "boolean") {
base[key] = obj[key];
} else if (typeof obj[key] === "string" && obj[key].toUpperCase() === "FAILED") {
Expand Down

0 comments on commit 2035d56

Please sign in to comment.