Skip to content

bug: Admin applications-by-status endpoint returns 500 when the result set is empty #690

@nora-weisser

Description

@nora-weisser

GET /api/platform/v1/admin/mentorship/cycles/{cycleId}/applications?status=... returns 500 Internal Server Error whenever the cycle has no applications matching the requested statuses. The endpoint cannot legitimately return an empty list — every admin portal tab that queries an empty bucket (common on a fresh cycle or QA environment) fails instead of showing "no results".

Image Image Image

Steps to reproduce

  1. In the admin portal, open the applications view for a cycle that has no applications in PENDING or MENTOR_REVIEWING.
  2. Observe the failed network call to GET /admin/mentorship/cycles/{cycleId}/applications?status=PENDING,MENTOR_REVIEWING.
  3. Or call directly with X-API-KEY and a bearer token on any cycle / status combination that matches no records.

Expected

  • 200 OK with an empty array [].

Actual

  • 500 Internal Server Error. Server logs show BadSqlGrammarException with the underlying message syntax error at or near ")" from a generated query of the shape SELECT * FROM mentees WHERE mentee_id IN ().

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions