Skip to content

Commit 84affcf

Browse files
committed
refactor(locks): drop redundant ensureWorkflowAccess fetch in rename
1 parent 6e369bb commit 84affcf

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

apps/sim/lib/copilot/tools/handlers/workflow/mutations.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,10 +637,9 @@ export async function executeRenameWorkflow(
637637
return { success: false, error: 'Workflow name must be 200 characters or less' }
638638
}
639639

640-
await ensureWorkflowAccess(workflowId, context.userId, 'write')
640+
const current = await ensureWorkflowAccess(workflowId, context.userId, 'write')
641641
await assertWorkflowMutable(workflowId)
642642
assertWorkflowMutationNotAborted(context)
643-
const current = await ensureWorkflowAccess(workflowId, context.userId, 'write')
644643
if (!current.workspaceId) {
645644
return { success: false, error: 'Workflow workspace is required' }
646645
}

0 commit comments

Comments
 (0)