api-server-setup #1
@@ -11,6 +11,8 @@ Server:
|
||||
|
||||
Need to timeout email reset tokens:
|
||||
|
||||
Need to impliment Reset / Delte JobListingContorller
|
||||
|
||||
Client:
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using BoredCareers.Services.DatabaseService;
|
||||
using BoredCareers.Entities;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace BoredCareers.Controllers {
|
||||
[ApiController]
|
||||
[Route("api/joblisting/")]
|
||||
public class JobListingController : MistoxControllerBase {
|
||||
|
||||
public JobListingController(DatabaseService db) : base(db) {}
|
||||
|
||||
[Route("getlistings")]
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> GetJobListings([FromForm] int page) {
|
||||
if (isLoggedIn()) {
|
||||
JobListing[] jobListings = await _databaseService.GetJobListingPage(page, 25); // 10 items per page
|
||||
return Ok(jobListings);
|
||||
}
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
[Route("getlisting")]
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> GetJobListing([FromForm] int JobListingID) {
|
||||
JobListing? jobListing = await _databaseService.GetJobListing(JobListingID);
|
||||
if (jobListing == null) {
|
||||
return Ok(jobListing);
|
||||
}
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
[Route("set")]
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> SetJobListing([FromBody] Resume resume) {
|
||||
await Task.Delay(1);
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[Route("delete")]
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> DeleteJobListing([FromForm] int ResumeID) {
|
||||
await Task.Delay(1);
|
||||
return Ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user