mirror of
https://github.com/valitydev/control-center.git
synced 2024-11-06 02:25:17 +00:00
Fix for domain forms (#228)
This commit is contained in:
parent
0f056768bf
commit
4868e7ca28
@ -26,8 +26,8 @@ export class FetchContractorService {
|
||||
])
|
||||
),
|
||||
map(([contractID, party]) => {
|
||||
const contractorID = party.contracts.get(contractID).contractor_id;
|
||||
return party.contractors.get(contractorID).contractor;
|
||||
const contractorID = party.contracts.get(contractID)?.contractor_id;
|
||||
return party.contractors.get(contractorID)?.contractor;
|
||||
}),
|
||||
shareReplay(1)
|
||||
);
|
||||
|
@ -4,7 +4,7 @@ import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { Observable } from 'rxjs';
|
||||
import { tap } from 'rxjs/internal/operators';
|
||||
|
||||
import { DomainTypedManager } from '../../../../../thrift-services';
|
||||
import { DomainCacheService } from '../../../../../thrift-services/damsel/domain-cache.service';
|
||||
import { BusinessScheduleObject } from '../../../../../thrift-services/damsel/gen-model/domain';
|
||||
|
||||
@Component({
|
||||
@ -24,14 +24,14 @@ export class BusinessScheduleSelectorComponent implements OnInit {
|
||||
|
||||
hasError = false;
|
||||
|
||||
constructor(private domainManager: DomainTypedManager, private snackBar: MatSnackBar) {}
|
||||
constructor(private domainCacheService: DomainCacheService, private snackBar: MatSnackBar) {}
|
||||
|
||||
selectionChange(change: MatSelectChange) {
|
||||
this.idChange.emit(change.value);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.schedules$ = this.domainManager.getBusinessScheduleObjects().pipe(
|
||||
this.schedules$ = this.domainCacheService.getObjects('business_schedule').pipe(
|
||||
tap(
|
||||
() => {
|
||||
this.isLoading = false;
|
||||
|
@ -12,7 +12,6 @@ import {
|
||||
PaymentInstitutionObject,
|
||||
PaymentInstitutionRef,
|
||||
} from '../../../../../thrift-services/damsel/gen-model/domain';
|
||||
import { findDomainObjects } from '../../../../../thrift-services/damsel/operations/utils';
|
||||
|
||||
@Component({
|
||||
selector: 'cc-payment-institution-ref',
|
||||
@ -39,8 +38,7 @@ export class PaymentInstitutionRefComponent implements OnInit {
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.paymentInstitutions$ = this.dtm.domain$.pipe(
|
||||
map((domain) => findDomainObjects(domain, 'payment_institution')),
|
||||
this.paymentInstitutions$ = this.dtm.getObjects('payment_institution').pipe(
|
||||
map((paymentInstitutions) =>
|
||||
sortBy(paymentInstitutions, (paymentInstitution) => paymentInstitution.ref.id)
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user