mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
CustomerType wurde bei existierender Kundenkarte nicht richtig erkannt
This commit is contained in:
@@ -24,7 +24,7 @@ export class CustomerDetailsComponent implements OnInit {
|
||||
customer$: Observable<CustomerDTO>;
|
||||
|
||||
customerFeatures$: Observable<KeyValueDTOOfStringAndString[]>;
|
||||
customerType$: Observable<'store' | 'b2b' | 'webshop' | 'guest'>;
|
||||
customerType$: Observable<string>;
|
||||
|
||||
canAdd$: Observable<boolean>;
|
||||
canEdit$: Observable<boolean>;
|
||||
@@ -98,7 +98,10 @@ export class CustomerDetailsComponent implements OnInit {
|
||||
map((features) => !!features.find((feature) => feature.description === 'Kundenkarte'))
|
||||
);
|
||||
this.customerType$ = this.customerFeatures$.pipe(
|
||||
map((features: KeyValueDTOOfStringAndString[]) => features[0].key as 'store' | 'webshop' | 'b2b' | 'guest')
|
||||
map(
|
||||
(features: KeyValueDTOOfStringAndString[]) =>
|
||||
features.find((f) => f.key === 'store' || f.key === 'webshop' || f.key === 'b2b' || f.key === 'guest')?.key
|
||||
)
|
||||
);
|
||||
|
||||
this.isB2b$ = this.customerType$.pipe(map((type) => type === 'b2b'));
|
||||
|
||||
Reference in New Issue
Block a user