From ff40124a1a975f5001e47cec1a6ad309d8eed2ae Mon Sep 17 00:00:00 2001 From: julianpoyourow Date: Tue, 9 Jul 2024 03:48:04 +0000 Subject: [PATCH 1/2] fix: improve .mcb compatibility --- packages/backend/src/routes/data.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/routes/data.js b/packages/backend/src/routes/data.js index 840c93b38..2e04caf8f 100644 --- a/packages/backend/src/routes/data.js +++ b/packages/backend/src/routes/data.js @@ -755,7 +755,7 @@ router.post( const grabFieldText = (field) => { if (!field) return ""; - if (field.li) { + if (field.li && Array.isArray(field.li)) { return field.li.map((item) => item._text).join("\n"); } @@ -765,7 +765,7 @@ router.post( const grabLabelTitles = (field) => { if (!field) return []; if (field._text) return [Util.cleanLabelTitle(field._text)]; - if (field.length) + if (Array.isArray(field) && field.length) return field.map((item) => Util.cleanLabelTitle(item._text)); return []; @@ -777,7 +777,7 @@ router.post( let originalPaths; if (field.path?._text || field._text) originalPaths = [field.path?._text || field._text]; - if (field.length) + if (Array.isArray(field) && field.length) originalPaths = field.map((item) => item.path?._text || item._text); if (!originalPaths) return []; From 069f54307f679c2ed06aff5821cb4c80b158d9ef Mon Sep 17 00:00:00 2001 From: julianpoyourow Date: Tue, 9 Jul 2024 04:06:15 +0000 Subject: [PATCH 2/2] chore: lint --- kube/configs/api-beta.pdb.yaml | 1 - kube/configs/api.pdb.yaml | 1 - kube/configs/browserless.pdb.yaml | 1 - 3 files changed, 3 deletions(-) diff --git a/kube/configs/api-beta.pdb.yaml b/kube/configs/api-beta.pdb.yaml index 0520f8a54..d68c7460a 100644 --- a/kube/configs/api-beta.pdb.yaml +++ b/kube/configs/api-beta.pdb.yaml @@ -7,4 +7,3 @@ spec: selector: matchLabels: app: rs-api-beta - diff --git a/kube/configs/api.pdb.yaml b/kube/configs/api.pdb.yaml index e5b9ca283..5cc51d670 100644 --- a/kube/configs/api.pdb.yaml +++ b/kube/configs/api.pdb.yaml @@ -7,4 +7,3 @@ spec: selector: matchLabels: app: rs-api - diff --git a/kube/configs/browserless.pdb.yaml b/kube/configs/browserless.pdb.yaml index 90a1dd2e5..ec3ed20db 100644 --- a/kube/configs/browserless.pdb.yaml +++ b/kube/configs/browserless.pdb.yaml @@ -7,4 +7,3 @@ spec: selector: matchLabels: app: rs-browserless -