working #31

Merged
derek merged 8 commits from working into main 2025-08-19 21:18:48 -07:00
2 changed files with 15 additions and 4 deletions
Showing only changes of commit ade5ac1212 - Show all commits
@@ -41,7 +41,7 @@
<img [src]="newListing.logo" />
<!-- Need to fix for image file upload -->
<div id="FileUploadPlaceholder" ></div>
<input type="file" (change)="onFileSelected($event)" accept="image/*" />
<input name="file" type="file" (change)="onFileSelected($event)" accept="image/*" />
<button type="button" (click)="prevStep()">Back</button>
<button type="button" (click)="nextStep()">Next</button>
@@ -64,7 +64,7 @@
</div>
<div class="half-frame">
<label>Company Phone Number</label>
<input class="input-field" name="email" [(ngModel)]="newListing.phone" type="text" placeholder="+1 800-000-0000" />
<input class="input-field" name="phone" [(ngModel)]="newListing.phone" type="text" placeholder="+1 800-000-0000" />
</div>
</div>
<button type="button" (click)="prevStep()">Back</button>
@@ -30,8 +30,19 @@ export class CompanyEditorComponent {
};
ngOnInit(){
// Query param CompanyID -> Edit
// Query param null -> New
this.route.queryParams.subscribe(params => {
const CompanyID = params['CompanyID'] ? +params['CompanyID'] : null;
if (CompanyID !== null){
this.http.get<Company>("api/company?CompanyID=" + CompanyID).subscribe({
next: data => {
this.newListing = data;
},
error: err => {
this.ErrorMsg = err.error;
}
});
}
});
}
ngAfterViewInit(){