diff --git a/JobTrackerApi/Controllers/JobApplicationsController.cs b/JobTrackerApi/Controllers/JobApplicationsController.cs index 4f0ba63..793df02 100644 --- a/JobTrackerApi/Controllers/JobApplicationsController.cs +++ b/JobTrackerApi/Controllers/JobApplicationsController.cs @@ -1405,9 +1405,7 @@ Canonical profile: if (title.Length == 0) return BadRequest("Job title is required."); if (request.CompanyId <= 0) return BadRequest("Valid companyId is required."); - var companyOk = await _db.Companies.AnyAsync(c => c.Id == request.CompanyId, cancellationToken); - if (!companyOk) return BadRequest("companyId does not exist."); - + // Scoped by the Company query filter, so this also rejects another user's companyId. var companyExists = await _db.Companies.AnyAsync(c => c.Id == request.CompanyId, cancellationToken); if (!companyExists) return BadRequest("companyId does not exist.");