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
@@ -10,4 +10,10 @@ export class Application {
public rating: number = 0; public rating: number = 0;
public notes: string = ""; public notes: string = "";
public trackUUID: string = crypto.randomUUID(); 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] [HttpPost]
public async Task<IActionResult> SetApplication([FromBody] Application application) { public async Task<IActionResult> SetApplication([FromBody] ApplicationRequest appReq) {
if (isLoggedIn()) { if (isLoggedIn()) {
if (application.AccountID == getLoggedInUserID()) { Application application = new Application() {
await _databaseService.SetApplication(application); AccountID = getLoggedInUserID(),
return Ok(); DateApplied = DateTime.UtcNow,
} JobListingID = appReq.JobListingID,
return NotFound("Cannot apply for someone else"); ResumeID = appReq.ResumeID,
ResponseEmail = appReq.ResponseEmail,
HasBeenViewed = false,
ResponseStatus = "",
Notes = "",
Rating = -1
};
await _databaseService.SetApplication(application);
return Ok();
} }
return NotFound("Not logged in"); return NotFound("Not logged in");
} }
+6
View File
@@ -11,4 +11,10 @@ namespace BoredCareers.Entities {
public int Rating { get; set; } public int Rating { get; set; }
public string Notes { 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; } = "";
}
} }