Skip to content

bug: TS2741 — Property 'links' missing in CardResponse return type of updateCard route #635

Description

@yachikadev

Bug Description

The backend typecheck (tsc --noEmit) fails consistently with the following error:

src/routes/cards.ts: error TS2741: Property 'links' is missing in type
'{ id: string; createdAt: Date; updatedAt: Date; userId: string; title: string;
description: string | null; slug: string; visibility: CardVisibility;
qrEnabled: boolean; viewCount: number; isDefault: boolean; }'
but required in type 'CardResponse'.

Location

apps/backend/src/routes/cards.ts — PUT /:id (updateCard route)

The handler return type is declared as Promise<CardResponse>, but
cardService.updateCard() returns an object that does not include the
links field required by CardResponse.

How to Reproduce

  1. Checkout main branch (clean, no local changes)
  2. Run npm --prefix apps/backend run typecheck
  3. Error appears immediately

Evidence of Pre-existing Nature

This error has surfaced in at least two separate PRs (#626, #632) on
completely unrelated changes — confirming it exists on main independent
of either PR's diff.

Likely Fix

cardService.updateCard() in cardService.ts needs to either:

  • Include links in its Prisma query (include: { links: true })
  • Or update the CardResponse type to make links optional if it's not
    always needed

Impact

Blocks backend-ci typecheck step for any PR targeting main that
touches backend files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions