Skip to content

Commit 2f686e8

Browse files
committed
fix(folders): stop the update path writing dropped columns
performUpdateFolder still copied color and isExpanded into its update payload after the cutover, so a caller passing either wrote against columns the generic folder table does not have. The create path had already dropped them. Typed the payload as Partial<typeof folder.$inferInsert> instead of Record<string, unknown> — the loose type is the reason typecheck caught every other dropped-column reference in this cutover but not this one.
1 parent d2272a9 commit 2f686e8

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

apps/sim/lib/workflows/orchestration/folder-lifecycle.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ export interface PerformUpdateFolderParams {
3939
workspaceId: string
4040
userId: string
4141
name?: string
42-
color?: string
43-
isExpanded?: boolean
4442
locked?: boolean
4543
parentId?: string | null
4644
sortOrder?: number
@@ -203,10 +201,10 @@ export async function performUpdateFolder(
203201
}
204202
}
205203

206-
const updates: Record<string, unknown> = { updatedAt: new Date() }
204+
// Typed against the table rather than `Record<string, unknown>`: the loose type is what
205+
// let `color`/`isExpanded` survive the cutover here after the create path dropped them.
206+
const updates: Partial<typeof folderTable.$inferInsert> = { updatedAt: new Date() }
207207
if (params.name !== undefined) updates.name = params.name.trim()
208-
if (params.color !== undefined) updates.color = params.color
209-
if (params.isExpanded !== undefined) updates.isExpanded = params.isExpanded
210208
if (params.locked !== undefined) updates.locked = params.locked
211209
if (params.parentId !== undefined) updates.parentId = params.parentId || null
212210
if (params.sortOrder !== undefined) updates.sortOrder = params.sortOrder

0 commit comments

Comments
 (0)