Skip to content

bug: Admin portal does not let the user enter long-term availability details; saving stores a hardcoded default #688

@nora-weisser

Description

@nora-weisser

The mentor create / edit form's "Mentorship Preferences" only exposes a "Mentorship Type" dropdown with two options ("Long Term", "Ad-Hoc"). There are no inputs for number of mentees or hours. Picking "Long Term" and saving stores { numMentee: 1, hours: 2 } for every mentor.

Steps to reproduce

  1. Pick a mentor with no menteeSection.longTerm.
  2. Open them in the admin portal edit form.
  3. "Mentorship Preferences" shows only the type dropdown — no inputs for mentees / hours.
  4. Pick "Long Term", save, read back.

Expected

  • Two inputs (mentees, hours) appear when "Long Term" is selected.
  • Saved values reflect what the admin entered.
  • Existing long-term mentors pre-fill the inputs with stored values.
  • Client-side rule hours / numMentee ≥ 2 enforced before submit.

Actual

Saved as "longTerm": { "numMentee": 1, "hours": 2 } regardless. Values are baked into the form's submit handler; no inputs exist.

Impact

Every long-term mentor configured via the portal lands at the minimum commitment. Richer configurations set via API are silently destroyed the moment anyone touches the mentor in the portal. No warning surfaces.

How to verify it is fixed

Form exposes inputs:

  • Edit form shows mentees and hours inputs in the "Long Term" section.
  • Existing long-term mentors pre-fill the inputs.

Negative — blocked client-side (and rejected by API as a fallback):

  • numMentee = 0 or empty.
  • hours = 0 or empty.
  • hours / numMentee < 2 (e.g. 3 mentees, 4 hours).

Positive — round-trips unchanged:

  • New long-term mentor with numMentee = 2, hours = 8 → saved as is.
  • Existing mentor numMentee = 3, hours = 12, saved without other changes → still 3, 12.
  • Toggling "Long Term" off and saving → longTerm becomes null and the mentor drops out of ?mentorshipTypes=LONG_TERM.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions