Skip to content

Job form Resume dropdown empty; empty resumeId can cause Prisma P2003 #91

Description

@AkshayChikhalkar

Summary

Resumes appear on the Profile page but not in the Resume dropdown when creating or editing a job. Users cannot assign a resume to a job. Saving with an empty/invalid resumeId can also fail with Prisma error P2003.

Steps to reproduce

  1. Create a resume on Profile (including one with fewer than 2 sections).
  2. Open My JobsAdd Job (or edit an existing job).
  3. Open the Resume dropdown.

Expected

All resumes belonging to the logged-in user appear in the dropdown (same set as Profile), and leaving Resume unselected saves with resumeId = null.

Actual

  • Dropdown is empty (or missing resumes that Profile shows), because the job form filters with MIN_RESUME_SECTIONS_FOR_SELECTION (2) while Profile uses minSections = 0.
  • Submitting an empty string for resume writes Job.resumeId = "" instead of null, which can trigger Prisma P2003 (foreign key constraint).
  • Create/update job does not validate that the selected resume belongs to the current user.

Suggested fix

  • Load the logged-in user’s resumes for the job form dropdown (no section-count filter for assignment).
  • Normalize empty resume/cover-letter selections to null.
  • Validate resume ownership before create/update.

Related

Not covered by existing issues (checked #76, #71, #49, #11 — different problems).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions