Skip to content

[UI] Patches list shows every patch as Pending in All-orgs mode (approvalStatus requires orgId) #2608

Description

@ToddHebebrand

Description

GET /patches only computes approvalStatus when ?orgId= is present, and the web client injects orgId only when a specific org is selected in the org switcher. In "All orgs" mode the Patches tab therefore renders every patch as Pending — including patches that have a partner-wide approval (patch_approvals.ring_id IS NULL).

Since approvals are partner-scoped (not org-scoped), the All-orgs view is exactly where an MSP would expect to see approval state — and it's wrong there.

Repro

Seeded dev stack, partner admin, org switcher on "All orgs" → /patches#patches → a patch with an existing partner-wide approval shows a Review/Pending state. Select a specific org → same patch shows Approved.

Proposed Fix

Compute approvalStatus from the caller's partnerId when no orgId is supplied (approvals don't need an org axis), or have the list endpoint fall back to partner-wide approvals.

Affected Files

  • apps/api/src/routes/patches/list.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions