Skip to content

Add-collaborator flow broken end-to-end (client {email} vs server {userId}) #50

Description

@Alimedhat000

Problem

The invite flow is half-built and its two halves disagree:

  • Client posts { email } (client/src/hooks/useCollaborators.ts:41)
  • Server destructures { userId, permission } (server/src/controllers/document.controller.ts:827) → Prisma crash / 500
  • The email input UI is commented out (collaborators-dropdown.tsx:81-96), hiding the breakage

No lookup-by-email endpoint exists server-side.

Related: #10 (dropdown functionality gaps).

Fix

Decide the contract — either an owner-facing lookup endpoint resolving email → userId, or accept email server-side — then restore the UI and cover it with a test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions