Add SQL for getting jobs under company
This commit is contained in:
1 parent
efb5193b21
commit
0971bedc42
2 files changed
+67
No files matched your search
@@ -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