Skip to content

Commit

Permalink
add check for arr
Browse files Browse the repository at this point in the history
  • Loading branch information
mutdmour committed Aug 4, 2022
1 parent 43a91b8 commit 40a43f5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export class AddNodeIds1658932910559 implements MigrationInterface {
await runChunked(queryRunner, workflowsQuery, (workflows) => {
workflows.forEach(async (workflow) => {
const nodes = workflow.nodes;
if (!Array.isArray(nodes)) {
return;
}
// @ts-ignore
nodes.forEach((node) => {
if (!node.id) {
Expand Down Expand Up @@ -55,6 +58,9 @@ export class AddNodeIds1658932910559 implements MigrationInterface {
await runChunked(queryRunner, workflowsQuery, (workflows) => {
workflows.forEach(async (workflow) => {
const nodes = workflow.nodes;
if (!Array.isArray(nodes)) {
return;
}
// @ts-ignore
nodes.forEach((node) => delete node.id );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export class AddNodeIds1658932090381 implements MigrationInterface {
await runChunked(queryRunner, workflowsQuery, (workflows) => {
workflows.forEach(async (workflow) => {
const nodes = workflow.nodes;
if (!Array.isArray(nodes)) {
return;
}

// @ts-ignore
nodes.forEach((node) => {
if (!node.id) {
Expand Down Expand Up @@ -67,6 +71,10 @@ export class AddNodeIds1658932090381 implements MigrationInterface {
await runChunked(queryRunner, workflowsQuery, (workflows) => {
workflows.forEach(async (workflow) => {
const nodes = workflow.nodes;
if (!Array.isArray(nodes)) {
return;
}

// @ts-ignore
nodes.forEach((node) => delete node.id );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export class AddNodeIds1658930531669 implements MigrationInterface {
await runChunked(queryRunner, workflowsQuery, (workflows) => {
workflows.forEach(async (workflow) => {
const nodes = JSON.parse(workflow.nodes);
if (!Array.isArray(nodes)) {
return;
}

nodes.forEach((node: INode) => {
if (!node.id) {
node.id = uuid();
Expand Down Expand Up @@ -61,6 +65,10 @@ export class AddNodeIds1658930531669 implements MigrationInterface {
await runChunked(queryRunner, workflowsQuery, (workflows) => {
workflows.forEach(async (workflow) => {
const nodes = JSON.parse(workflow.nodes);
if (!Array.isArray(nodes)) {
return;
}

// @ts-ignore
nodes.forEach((node) => delete node.id );

Expand Down

0 comments on commit 40a43f5

Please sign in to comment.