Skip to content

[CORRUPTED] Synthetic Benchmark PR #26644 - feat: api v2 team invite link endpoint#668

Open
tomerqodo wants to merge 2 commits intobase_pr_26644_20260121_9237from
corrupted_pr_26644_20260121_9237
Open

[CORRUPTED] Synthetic Benchmark PR #26644 - feat: api v2 team invite link endpoint#668
tomerqodo wants to merge 2 commits intobase_pr_26644_20260121_9237from
corrupted_pr_26644_20260121_9237

Conversation

@tomerqodo
Copy link

Benchmark PR calcom#26644

Type: Corrupted (contains bugs)

Original PR Title: feat: api v2 team invite link endpoint
Original PR Description: ## What does this PR do?

Adds a new API v2 endpoint to create team invite links. Addresses Linear CAL-7046 by providing a simple way for admins to generate tokens and shareable links.

  • Fixes CAL-7046

New Endpoint

  • POST /v2/teams/:teamId/invite - Returns token and inviteLink
  • Requires TEAM_ADMIN role and API authentication
  • Works for both regular teams and organization sub-teams (the existing TeamService.createInvite method handles both contexts appropriately)

Implementation Details

  • Added TeamsInviteController with the new invite endpoint
  • Created CreateInviteOutputDto and InviteDataDto for response types (following API v2 conventions with SUCCESS_STATUS/ERROR_STATUS constants)
  • Wired TeamsInviteModule into the platform endpoints
  • Reuses existing TeamService.createInvite method which generates the correct invite link format based on context:
    • Organization context: routes via /signup with callback to /getting-started
    • Regular team context: routes to /teams

Tests

  • E2E tests covering:
    • Team admin can create invites successfully
    • New token generated on each request
    • Team members (non-admin) receive 403
    • Non-members receive 403

Updates since last revision

  • Fixed E2E test failure: Changed supertest import from import * as request from "supertest" to import request from "supertest" (default import) to match the pattern used by all other API v2 E2E tests

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A - endpoint follows existing patterns
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Create a team and ensure the authenticated user is a team admin
  2. Call POST /v2/teams/:teamId/invite with valid API authentication
  3. Verify response contains status: "success", data.token, and data.inviteLink
  4. Verify non-admin members and non-members receive 403 responses

Checklist for human review

  • Verify E2E tests pass after the supertest import fix
  • Confirm TeamService.createInvite generates correct links for both regular teams and org sub-teams

Link to Devin run: https://app.devin.ai/sessions/f7c710a65b90495a89c321afb8dc2f65
Requested by: @Ryukemeister (rajiv@cal.com)
Original PR URL: calcom#26644

@github-actions
Copy link

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "[CORRUPTED] Synthetic Benchmark PR #26644 - feat: api v2 team invite link endpoint". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@github-actions
Copy link

This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active.

@github-actions github-actions bot added the Stale label Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant