Skip to content

Commit 84a8b91

Browse files
committed
fix(rocketlane): require an owner reference when creating a project, matching the API contract
1 parent f682759 commit 84a8b91

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/sim/tools/rocketlane/create_project.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,13 @@ export const rocketlaneCreateProjectTool: ToolConfig<
284284
projectName: params.projectName,
285285
customer: { companyName: params.customerCompanyName },
286286
}
287+
if (params.ownerUserId == null && !params.ownerEmailId) {
288+
throw new Error('Either an owner user ID or an owner email is required to create a project')
289+
}
287290
const owner: Record<string, unknown> = {}
288291
if (params.ownerUserId != null) owner.userId = params.ownerUserId
289292
if (params.ownerEmailId) owner.emailId = params.ownerEmailId
290-
if (Object.keys(owner).length > 0) body.owner = owner
293+
body.owner = owner
291294
if (params.startDate) body.startDate = params.startDate
292295
if (params.dueDate) body.dueDate = params.dueDate
293296
if (params.visibility) body.visibility = params.visibility

0 commit comments

Comments
 (0)