Add SQL for getting jobs under company

This commit is contained in:
2025-07-30 21:02:27 -07:00
parent efb5193b21
commit 0971bedc42
2 changed files with 67 additions and 0 deletions
@@ -19,6 +19,18 @@ namespace BoredCareers.Controllers {
return NotFound("Job listing not found");
}
[HttpGet("company")]
public async Task<IActionResult> GetCompanysJobListings([FromQuery] int CompanyID) {
if (isLoggedIn()) {
if (await isLoggedInUserEmployeeOf(CompanyID)) {
JobListing[] jobListings = await _databaseService.GetJobListingFromCompany(CompanyID);
return Ok(jobListings);
}
return NotFound("You are not an employee of company");
}
return NotFound("Not logged in");
}
[HttpGet]
public async Task<IActionResult> GetJobListings(int Page = 1, int PageQuantity = 25) {
JobListing[] jobListings = await _databaseService.GetJobListingPage(Page, PageQuantity);