Add SQL for getting jobs under company
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user