Cleanup apply process
This commit is contained in:
@@ -11,3 +11,9 @@ export class Application {
|
||||
public notes: string = "";
|
||||
public trackUUID: string = crypto.randomUUID();
|
||||
}
|
||||
|
||||
export class ApplicationRequest {
|
||||
public resumeID: number = 0;
|
||||
public jobListingID: number = 0;
|
||||
public responseEmail: string = "";
|
||||
}
|
||||
@@ -28,13 +28,21 @@ namespace BoredCareers.Controllers {
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> SetApplication([FromBody] Application application) {
|
||||
public async Task<IActionResult> SetApplication([FromBody] ApplicationRequest appReq) {
|
||||
if (isLoggedIn()) {
|
||||
if (application.AccountID == getLoggedInUserID()) {
|
||||
await _databaseService.SetApplication(application);
|
||||
return Ok();
|
||||
}
|
||||
return NotFound("Cannot apply for someone else");
|
||||
Application application = new Application() {
|
||||
AccountID = getLoggedInUserID(),
|
||||
DateApplied = DateTime.UtcNow,
|
||||
JobListingID = appReq.JobListingID,
|
||||
ResumeID = appReq.ResumeID,
|
||||
ResponseEmail = appReq.ResponseEmail,
|
||||
HasBeenViewed = false,
|
||||
ResponseStatus = "",
|
||||
Notes = "",
|
||||
Rating = -1
|
||||
};
|
||||
await _databaseService.SetApplication(application);
|
||||
return Ok();
|
||||
}
|
||||
return NotFound("Not logged in");
|
||||
}
|
||||
|
||||
@@ -11,4 +11,10 @@ namespace BoredCareers.Entities {
|
||||
public int Rating { get; set; }
|
||||
public string Notes { get; set; } = "";
|
||||
}
|
||||
|
||||
public class ApplicationRequest {
|
||||
public int ResumeID { get; set; } // FK
|
||||
public int JobListingID { get; set; } // FK
|
||||
public string ResponseEmail { get; set; } = "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user