Skip to content

bug: GET /api/cms/v1/mentorship/mentors?mentorshipTypes=AD_HOC ignores the open cycle's month #704

@nora-weisser

Description

@nora-weisser

Problem

The AD_HOC filter only checks that menteeSection.adHoc is non-empty. It does not match the mentor's adHoc[].month against the open cycle's month. A mentor whose only declared availability is JULY shows up — and is selectable — under a JUNE cycle.

Evidence

GET /api/platform/v1/admin/mentorship/cycles/all — only JUNE is open:

id=1 year=2026 month=MARCH    type=Long-Term status=CLOSED
id=2 year=2026 month=MAY      type=Ad-Hoc    status=DRAFT
id=3 year=2026 month=JUNE     type=Ad-Hoc    status=OPEN
id=4 year=2026 month=JULY     type=Ad-Hoc    status=DRAFT
...

GET /api/cms/v1/mentorship/mentors?mentorshipTypes=AD_HOC — mentor 7 still appears even though their only month is JULY:

id=7  Edit Test Mentor   adHoc=[{month: JULY, hours: 4}]   ← shouldn't be here
id=27 June Ad-hoc Mentor adHoc=[{month: JUNE, hours: 4}]
id=28 Both Cycles Mentor adHoc=[{month: JUNE, hours: 3}, {month: JULY, hours: 3}]

Metadata

Metadata

Assignees

Labels

ad-hocbugSomething 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