Skip to content

Commit 6695013

Browse files
committed
fix(copilot): use newName instead of name for table rename operation
1 parent 5c0a7b4 commit 6695013

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

apps/sim/lib/copilot/tools/server/table/user-table.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -883,8 +883,9 @@ export const userTableServerTool: BaseServerTool<UserTableArgs, UserTableResult>
883883
if (!args.tableId) {
884884
return { success: false, message: 'Table ID is required' }
885885
}
886-
if (!args.name) {
887-
return { success: false, message: 'Name is required for renaming a table' }
886+
const newName = (args as Record<string, unknown>).newName as string | undefined
887+
if (!newName) {
888+
return { success: false, message: 'newName is required for renaming a table' }
888889
}
889890
if (!workspaceId) {
890891
return { success: false, message: 'Workspace ID is required' }
@@ -899,7 +900,7 @@ export const userTableServerTool: BaseServerTool<UserTableArgs, UserTableResult>
899900
}
900901

901902
const requestId = crypto.randomUUID().slice(0, 8)
902-
const renamed = await renameTable(args.tableId, args.name, requestId)
903+
const renamed = await renameTable(args.tableId, newName, requestId)
903904

904905
return {
905906
success: true,

0 commit comments

Comments
 (0)