Skip to content

Commit

Permalink
fix: improve .mcb compatibility (#1406)
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpoy authored Jul 9, 2024
2 parents 2a83071 + 069f543 commit eb5e6e6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion kube/configs/api-beta.pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ spec:
selector:
matchLabels:
app: rs-api-beta

1 change: 0 additions & 1 deletion kube/configs/api.pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ spec:
selector:
matchLabels:
app: rs-api

1 change: 0 additions & 1 deletion kube/configs/browserless.pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ spec:
selector:
matchLabels:
app: rs-browserless

6 changes: 3 additions & 3 deletions packages/backend/src/routes/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand All @@ -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 [];
Expand All @@ -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 [];
Expand Down

0 comments on commit eb5e6e6

Please sign in to comment.