refactor(ticket-selector): stop sending excluded variants

This commit is contained in:
2026-08-14 09:54:44 -03:00
parent 1cb2cf3d54
commit f80d146012
3 changed files with 0 additions and 9 deletions

View File

@@ -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> {

View File

@@ -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');

View File

@@ -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({