working #13

Merged
derek merged 3 commits from working into main 2025-07-30 22:01:36 -07:00
6 changed files with 8 additions and 8 deletions
Showing only changes of commit f3a0611b1d - Show all commits
@@ -1,5 +1,5 @@
<div class="top-bar"> <div class="top-bar">
<button *ngFor="let company of Employers" (click)="changeSelectedCompany(company.company.id)">{{ company.company.name.toUpperCase() }}</button> <button *ngFor="let company of Employers" (click)="changeSelectedCompany(company.company.id!)">{{ company.company.name.toUpperCase() }}</button>
<button routerLink="/company/connect" >CONNECT A COMPANY</button> <button routerLink="/company/connect" >CONNECT A COMPANY</button>
</div> </div>
<div class="content-frame"> <div class="content-frame">
@@ -18,6 +18,6 @@
<h1>Modified: {{ cur.modifiedTime }}</h1> <h1>Modified: {{ cur.modifiedTime }}</h1>
</div> </div>
<button [routerLink]="['/jobs/editor']" [queryParams]="{ JobID: cur.id }" >EDIT</button> <button [routerLink]="['/jobs/editor']" [queryParams]="{ JobID: cur.id }" >EDIT</button>
<button (click)="RemoveJobListing(cur.id)">DELETE</button> <button (click)="RemoveJobListing(cur.id!)">DELETE</button>
</div> </div>
</div> </div>
@@ -71,7 +71,7 @@ export class JobEditorComponent {
} }
PostJobListing(jobListing: JobListing){ PostJobListing(jobListing: JobListing){
jobListing.companyID = this.selectedCompany.id; jobListing.companyID = this.selectedCompany.id!;
this.http.post("api/joblisting", jobListing).subscribe({ this.http.post("api/joblisting", jobListing).subscribe({
next: data => { next: data => {
this.router.navigate([""]); this.router.navigate([""]);
+2 -2
View File
@@ -26,7 +26,7 @@ namespace BoredCareers.Controllers {
public async Task<IActionResult> SetCompany([FromBody] Company company, [FromQuery] bool newCompany = false) { public async Task<IActionResult> SetCompany([FromBody] Company company, [FromQuery] bool newCompany = false) {
if (isLoggedIn()) { if (isLoggedIn()) {
if (newCompany) { if (newCompany) {
Company? test = await _databaseService.GetCompany(company.ID); Company? test = await _databaseService.GetCompany(Convert.ToInt32(company.ID));
if (test == null) { if (test == null) {
company.ID = await _databaseService.SetCompany(company); company.ID = await _databaseService.SetCompany(company);
await _databaseService.SetEmployee(new Employee() { await _databaseService.SetEmployee(new Employee() {
@@ -37,7 +37,7 @@ namespace BoredCareers.Controllers {
} }
return NotFound("The company already exists"); return NotFound("The company already exists");
} else { } else {
if (await isLoggedInUserEmployeeOf(company.ID)) { if (await isLoggedInUserEmployeeOf(Convert.ToInt32(company.ID))) {
await _databaseService.SetCompany(company); await _databaseService.SetCompany(company);
return Ok(); return Ok();
} }
+2 -2
View File
@@ -34,7 +34,7 @@ namespace BoredCareers.Controllers {
[HttpPost] [HttpPost]
public async Task<IActionResult> SetEmployee([FromBody] Employee employee) { public async Task<IActionResult> SetEmployee([FromBody] Employee employee) {
if (isLoggedIn()) { if (isLoggedIn()) {
if (await isLoggedInUserEmployeeOf(employee.Company.ID)) { if (await isLoggedInUserEmployeeOf(Convert.ToInt32(employee.Company.ID))) {
await _databaseService.SetEmployee(employee); await _databaseService.SetEmployee(employee);
return Ok(); return Ok();
} }
@@ -48,7 +48,7 @@ namespace BoredCareers.Controllers {
if (isLoggedIn()) { if (isLoggedIn()) {
Employee? employee = await _databaseService.GetEmployee(EmployeeID); Employee? employee = await _databaseService.GetEmployee(EmployeeID);
if (employee != null) { if (employee != null) {
if (await isLoggedInUserEmployeeOf(employee.Company.ID)) { if (await isLoggedInUserEmployeeOf(Convert.ToInt32(employee.Company.ID))) {
await _databaseService.DeleteEmployee(EmployeeID); await _databaseService.DeleteEmployee(EmployeeID);
return Ok(); return Ok();
} }
@@ -143,7 +143,7 @@ namespace BoredCareers.Services.DatabaseService {
// Split into grouped lists and add to experience // Split into grouped lists and add to experience
Dictionary<int, ResumeExperienceBullet[]> groupedExperienceBullets = experienceBullets.GroupBy(b => b.ResumeExperienceID).ToDictionary(g => g.Key, g => g.ToArray()); Dictionary<int, ResumeExperienceBullet[]> groupedExperienceBullets = experienceBullets.GroupBy(b => b.ResumeExperienceID).ToDictionary(g => g.Key, g => g.ToArray());
foreach (ResumeExperience cur in experience) { foreach (ResumeExperience cur in experience) {
cur.ExperienceBullets = groupedExperienceBullets[cur.ID]; cur.ExperienceBullets = groupedExperienceBullets[Convert.ToInt32(cur.ID)];
} }
// Add the parts to the resume // Add the parts to the resume