Skip to content

API: Implement Board paper management endpoints #3

Description

@lucianfialho

Problem

Users need to add and remove papers from their curated collections. Currently there are no endpoints for managing papers within a board.

Solution

Implement endpoints to manage the papers within a board.

Acceptance Criteria

  • POST /api/boards/[id]/papers - Add paper to board

    • Request body: { paperId: string, notes?: string }
    • Response: { id, boardId, paperId, addedAt }
    • Checks if paper exists in papers table
    • Prevents duplicate paper entries (returns existing if already there)
    • Requires editor+ role on board
  • DELETE /api/boards/[id]/papers/[paperId] - Remove paper

    • No request body needed
    • Returns 204 on success
    • Requires editor+ role on board
    • Returns 404 if paper not in board
  • PATCH /api/boards/[id]/papers/[paperId] - Update paper metadata in board (optional)

    • Request body: { notes? }
    • Updates board-specific metadata about the paper
    • Requires editor+ role
  • GET /api/boards/[id]/papers - List board papers

    • Query params: limit=20, offset=0, sort=added|title|authors
    • Response: { papers: PaperWithBoardMeta[], total: number }
    • Includes full paper details + board-specific data

Dependencies

Notes

  • When adding a paper, check if it exists in papers table; if not, fetch from arXiv/Crossref first
  • Paper removal should cascade properly via db schema
  • Maintain paper count on board for display purposes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions