Cleanup apply process

This commit is contained in:
2025-10-15 17:04:33 -07:00
parent 1de00480cc
commit 0f557a5bc7
3 changed files with 26 additions and 6 deletions
+6
View File
@@ -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,14 +28,22 @@ 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()) {
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("Cannot apply for someone else");
}
return NotFound("Not logged in");
}
+6
View File
@@ -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; } = "";
}
}