Cleanup apply process
This commit is contained in:
@@ -11,3 +11,9 @@ export class Application {
|
|||||||
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,14 +28,22 @@ 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() {
|
||||||
|
AccountID = getLoggedInUserID(),
|
||||||
|
DateApplied = DateTime.UtcNow,
|
||||||
|
JobListingID = appReq.JobListingID,
|
||||||
|
ResumeID = appReq.ResumeID,
|
||||||
|
ResponseEmail = appReq.ResponseEmail,
|
||||||
|
HasBeenViewed = false,
|
||||||
|
ResponseStatus = "",
|
||||||
|
Notes = "",
|
||||||
|
Rating = -1
|
||||||
|
};
|
||||||
await _databaseService.SetApplication(application);
|
await _databaseService.SetApplication(application);
|
||||||
return Ok();
|
return Ok();
|
||||||
}
|
}
|
||||||
return NotFound("Cannot apply for someone else");
|
|
||||||
}
|
|
||||||
return NotFound("Not logged in");
|
return NotFound("Not logged in");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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; } = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user