Skip to content

Commit

Permalink
Merge pull request ever-co#1087 from ever-co/fix/1086-merchant-data
Browse files Browse the repository at this point in the history
fix: ever-co#1086 merchant data
  • Loading branch information
rmagon authored May 3, 2020
2 parents 5165d37 + 77222e0 commit 0e0bc18
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { LocationFormComponent } from '../../../../@shared/forms/location';
import { WarehouseRouter } from '@modules/client.common.angular2/routers/warehouse-router.service';
import Warehouse from '@modules/server.common/entities/Warehouse';
import { WarehouseManageTabsComponent } from '../../../../@shared/warehouse/forms/warehouse-manage-tabs/warehouse-manage-tabs.component';
import 'rxjs/add/operator/withLatestFrom';

@Component({
selector: 'ea-warehouse-manage',
Expand Down Expand Up @@ -47,15 +46,17 @@ export class WarehouseManageComponent implements OnInit {
) {}

ngOnInit() {
this.warehouseId$.subscribe((id) => {
this.warehouseRouter
.get(id)
.pipe()
.subscribe((warehouse) => {
this._currentWarehouse = warehouse;
this.warehouseManageTabs.setValue(warehouse);
});
});
this.loadWarehouse();
}

async loadWarehouse() {
const warehouseId = await this.warehouseId$.pipe(first()).toPromise();
const warehouse = await this.warehouseRouter
.get(warehouseId)
.pipe(first())
.toPromise();
this._currentWarehouse = warehouse;
this.warehouseManageTabs.setValue(warehouse);
}

get validForm() {
Expand Down

0 comments on commit 0e0bc18

Please sign in to comment.