refactor(ticket-selector): stop sending excluded variants
This commit is contained in:
@@ -92,7 +92,6 @@ export class CatalogService extends BaseApiService {
|
||||
catalogItemId: number,
|
||||
payload: {
|
||||
selected_values: Record<string, string | string[]>;
|
||||
excluded_variant_ids?: number[];
|
||||
cart_item_id?: number | null;
|
||||
},
|
||||
): Observable<CatalogVariantOptionsResponse> {
|
||||
|
||||
@@ -92,7 +92,6 @@ describe('ProductTicketSelectorComponent', () => {
|
||||
|
||||
expect(catalogService.getVariantOptions).toHaveBeenLastCalledWith(7, {
|
||||
selected_values: { sector: 'a' },
|
||||
excluded_variant_ids: [],
|
||||
cart_item_id: null,
|
||||
});
|
||||
expect(fixture.componentInstance['rows']()[0].status).toBe('selecting');
|
||||
|
||||
@@ -199,16 +199,9 @@ export class ProductTicketSelectorComponent {
|
||||
error: null,
|
||||
});
|
||||
|
||||
const excludedVariantIds = this.rows()
|
||||
.filter((candidate) => candidate.id !== rowId)
|
||||
.flatMap((candidate) => {
|
||||
const variantId = candidate.reservedVariantId ?? candidate.variantId;
|
||||
return variantId === null ? [] : [variantId];
|
||||
});
|
||||
const request = this.catalogService
|
||||
.getVariantOptions(this.productId(), {
|
||||
selected_values: selectedValues,
|
||||
excluded_variant_ids: excludedVariantIds,
|
||||
cart_item_id: row.cartItemId,
|
||||
})
|
||||
.subscribe({
|
||||
|
||||
Reference in New Issue
Block a user