From c57ac574c43fb019c163a3f7ea19361e314e8731 Mon Sep 17 00:00:00 2001 From: Derek Holloway Date: Thu, 17 Jul 2025 22:23:17 -0700 Subject: [PATCH] Layout framework for new job --- .../pages/main/jobs/edit/jobedit.component.ts | 2 +- .../pages/main/jobs/new/jobnew.component.html | 70 +++++++++++++++---- .../pages/main/jobs/new/jobnew.component.ts | 31 ++------ 3 files changed, 63 insertions(+), 40 deletions(-) diff --git a/src/Client/src/app/pages/main/jobs/edit/jobedit.component.ts b/src/Client/src/app/pages/main/jobs/edit/jobedit.component.ts index 33bd400..35075b9 100644 --- a/src/Client/src/app/pages/main/jobs/edit/jobedit.component.ts +++ b/src/Client/src/app/pages/main/jobs/edit/jobedit.component.ts @@ -22,7 +22,7 @@ export class JobEditComponent { public Page: number = 1; constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) { - this.title.setTitle("Jobs | BoredCareers"); + this.title.setTitle("Jobs - edit | BoredCareers"); if (this.Page == 1){ diff --git a/src/Client/src/app/pages/main/jobs/new/jobnew.component.html b/src/Client/src/app/pages/main/jobs/new/jobnew.component.html index 05e4dca..c9e2958 100644 --- a/src/Client/src/app/pages/main/jobs/new/jobnew.component.html +++ b/src/Client/src/app/pages/main/jobs/new/jobnew.component.html @@ -1,16 +1,56 @@ -
-
-

{{ cur.title }}

-

{{ cur.jobType }}

-

Is Remote: {{ cur.remote }}

-

{{ cur.salaryMin }}

-

{{ cur.salaryMax }}

-

{{ cur.city }}

-

{{ cur.stateOrRegion }}

-

{{ cur.country }}

-

{{ cur.postalCode }}

-

{{ cur.description }}

-

Posted: {{ cur.createdTime }}

-

Modified: {{ cur.modifiedTime }}

+
+
+

Title

+
-
\ No newline at end of file +
+

Description

+ +
+
+
+

Postal Code

+ +
+
+

Country

+ +
+
+

State/Region

+ +
+
+

City

+ +
+
+
+
+

Minimum Salary

+ +
+
+

Maximum Salary

+ +
+
+
+

Job Type

+ +
+
+

Remote Position

+ +
+
+ +
+ \ No newline at end of file diff --git a/src/Client/src/app/pages/main/jobs/new/jobnew.component.ts b/src/Client/src/app/pages/main/jobs/new/jobnew.component.ts index 9e7e3b0..f4a8b35 100644 --- a/src/Client/src/app/pages/main/jobs/new/jobnew.component.ts +++ b/src/Client/src/app/pages/main/jobs/new/jobnew.component.ts @@ -15,37 +15,20 @@ import { Authentication } from 'app/services/Authentication'; }) export class JobNewComponent { - public MyJobListings: JobListing[] = []; - public JobListingPage: JobListing[] = []; + public newListing: JobListing = new JobListing(); public ErrorMsg: string = ""; - public Page: number = 1; - - constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) { - this.title.setTitle("Jobs | BoredCareers"); - - if (this.Page == 1){ - - } - - http.get("api/joblisting?PageQuantity=" + 10 + "&Page=" + 1).subscribe({ - next: data => { - this.JobListingPage = data; - }, - error: err => { - this.ErrorMsg = err.error; - } - }); - + constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) { + this.title.setTitle("Jobs - new | BoredCareers"); }; - RemoveJobListing( JobListingID: number ){ - this.http.delete("api/joblisting?JobListingID=" + JobListingID).subscribe({ + PostJobListing(jobListing: JobListing){ + this.http.post("api/joblisting", jobListing).subscribe({ next: data => { - window.location.reload(); + }, error: err => { - alert("Failed to delete the job listing. Try again"); + alert("Failed to create the job listing. Try again"); } }); }