fix: Add new route to create team routing-form response#22347
fix: Add new route to create team routing-form response#22347hariombalhara merged 5 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
✅ No security or compliance issues detected. Reviewed everything up to a20e98b. Security Overview
Detected Code ChangesThe diff is too large to display a summary of code changes. Reply to this PR with |
48759fa to
6410687
Compare
76e905f to
4718b8b
Compare
4718b8b to
505d6e4
Compare
…ownership_with_org_guard
| const result = await this.organizationsRoutingFormsResponsesService.createRoutingFormResponseWithSlots( | ||
| orgId, | ||
| routingFormId, |
| } | ||
|
|
||
| // Extract event type information from the routed URL | ||
| const { eventTypeId, crmParams } = await this.extractEventTypeAndCrmParams(redirectUrl); | ||
|
|
||
| const paramsForGetAvailableSlots = { | ||
| type: ById_2024_09_04_type, | ||
| eventTypeId, | ||
| ...slotsQuery, | ||
| ...crmParams, | ||
| } as const; | ||
|
|
||
| // Get available slots using the slots service with CRM parameters | ||
| const slots = await this.slotsService.getAvailableSlots(paramsForGetAvailableSlots); | ||
| const teamMemberIds = crmParams.routedTeamMemberIds ?? []; | ||
| const teamMemberEmail = crmParams.teamMemberEmail ?? undefined; | ||
| const skipContactOwner = crmParams.skipContactOwner ?? undefined; | ||
| const queuedResponseId = crmParams.queuedFormResponseId ?? null; | ||
| const responseId = crmParams.routingFormResponseId ?? null; | ||
| const crmAppSlug = crmParams.crmAppSlug ?? undefined; | ||
| const crmOwnerRecordType = crmParams.crmOwnerRecordType ?? undefined; | ||
|
|
||
| if (responseId) { | ||
| return { | ||
| routing: { | ||
| responseId, | ||
| teamMemberEmail, | ||
| teamMemberIds, | ||
| skipContactOwner, | ||
| crmAppSlug, | ||
| crmOwnerRecordType, | ||
| }, | ||
| eventTypeId, | ||
| slots, |
There was a problem hiding this comment.
Moved all this to shared service
| @Req() request: Request | ||
| ): Promise<CreateRoutingFormResponseOutput> { | ||
| const result = await this.organizationsRoutingFormsResponsesService.createRoutingFormResponseWithSlots( | ||
| orgId, |
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (07/09/25)1 reviewer was added to this PR based on Keith Williams's automation. |
There was a problem hiding this comment.
cubic found 2 issues across 12 files. Review them in cubic.dev
React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.
...tions/routing-forms/controllers/organizations-routing-forms-responses.controller.e2e-spec.ts
Outdated
Show resolved
Hide resolved
apps/api/v2/src/modules/auth/guards/organizations/is-user-routing-form.guard.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
cubic found 4 issues across 15 files. Review them in cubic.dev
React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.
.../v2/src/modules/organizations/routing-forms/services/shared-routing-form-response.service.ts
Show resolved
Hide resolved
.../v2/src/modules/organizations/routing-forms/services/shared-routing-form-response.service.ts
Show resolved
Hide resolved
.../v2/src/modules/organizations/routing-forms/services/shared-routing-form-response.service.ts
Show resolved
Hide resolved
E2E results are ready! |
supalarry
left a comment
There was a problem hiding this comment.
Love the new shared service and tests, but have some comments below:
.../organizations/routing-forms/controllers/organizations-routing-forms-responses.controller.ts
Outdated
Show resolved
Hide resolved
…ownership_with_org_guard
9ac891f to
a20e98b
Compare
)" This reverts commit 89e7fca.
* fix: Add formId ownership with org guard * Don't allow user routing form endpoint to create response for team routing form * rename to or guard
…com#22347)" (calcom#22399) This reverts commit 89e7fca.

What does this PR do?
Follow up to #22239
Organization Teams Routing Forms Response Endpoint
This PR adds a new teams routing forms endpoint that reuses existing routing form response logic by creating a shared service. The changes extract common functionality into a
SharedRoutingFormResponseServiceand add a new teams-specific route while maintaining the existing organization-level endpoint.Key Changes
Architecture
SharedRoutingFormResponseServiceto centralize routing form response logicAPI Endpoints
Security & Validation
IsUserRoutingFormguard for proper form ownership validationThe implementation follows established patterns while extending functionality to support team-level routing forms without duplicating core logic.
A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).
Mandatory Tasks (DO NOT REMOVE)