Create edit company
This commit is contained in:
@@ -41,7 +41,7 @@
|
|||||||
<img [src]="newListing.logo" />
|
<img [src]="newListing.logo" />
|
||||||
<!-- Need to fix for image file upload -->
|
<!-- Need to fix for image file upload -->
|
||||||
<div id="FileUploadPlaceholder" ></div>
|
<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)="prevStep()">Back</button>
|
||||||
<button type="button" (click)="nextStep()">Next</button>
|
<button type="button" (click)="nextStep()">Next</button>
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="half-frame">
|
<div class="half-frame">
|
||||||
<label>Company Phone Number</label>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
<button type="button" (click)="prevStep()">Back</button>
|
<button type="button" (click)="prevStep()">Back</button>
|
||||||
|
|||||||
@@ -30,8 +30,19 @@ export class CompanyEditorComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ngOnInit(){
|
ngOnInit(){
|
||||||
// Query param CompanyID -> Edit
|
this.route.queryParams.subscribe(params => {
|
||||||
// Query param null -> New
|
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(){
|
ngAfterViewInit(){
|
||||||
|
|||||||
Reference in New Issue
Block a user