Skip to content

Commit cc74921

Browse files
Merge pull request #521 from simstudioai/fix/normalized-tables-type-bug
Fix/normalized tables type bug
2 parents c1487af + ecece02 commit cc74921

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

apps/sim/lib/workflows/db-helpers.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,12 +552,12 @@ describe('Database Helpers', () => {
552552
workflowId: mockWorkflowId,
553553
type: 'starter',
554554
name: 'Start Block',
555-
positionX: 100,
556-
positionY: 100,
555+
positionX: '100',
556+
positionY: '100',
557557
enabled: true,
558558
horizontalHandles: true,
559559
isWide: false,
560-
height: 150,
560+
height: '150',
561561
parentId: null,
562562
extent: null,
563563
})

apps/sim/lib/workflows/db-helpers.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ export async function loadWorkflowFromNormalizedTables(
4343
type: block.type,
4444
name: block.name,
4545
position: {
46-
x: block.positionX,
47-
y: block.positionY,
46+
x: Number(block.positionX),
47+
y: Number(block.positionY),
4848
},
4949
enabled: block.enabled,
5050
horizontalHandles: block.horizontalHandles,
5151
isWide: block.isWide,
52-
height: block.height,
52+
height: Number(block.height),
5353
subBlocks: block.subBlocks || {},
5454
outputs: block.outputs || {},
5555
data: block.data || {},
@@ -131,12 +131,12 @@ export async function saveWorkflowToNormalizedTables(
131131
workflowId: workflowId,
132132
type: block.type,
133133
name: block.name || '',
134-
positionX: block.position?.x || 0,
135-
positionY: block.position?.y || 0,
134+
positionX: String(block.position?.x || 0),
135+
positionY: String(block.position?.y || 0),
136136
enabled: block.enabled ?? true,
137137
horizontalHandles: block.horizontalHandles ?? true,
138138
isWide: block.isWide ?? false,
139-
height: block.height || 0,
139+
height: String(block.height || 0),
140140
subBlocks: block.subBlocks || {},
141141
outputs: block.outputs || {},
142142
data: block.data || {},

0 commit comments

Comments
 (0)