diff --git a/src/app/pages/door-check/door-check.page.ts b/src/app/pages/door-check/door-check.page.ts index d894d63f..f374c343 100644 --- a/src/app/pages/door-check/door-check.page.ts +++ b/src/app/pages/door-check/door-check.page.ts @@ -331,8 +331,18 @@ export class DoorCheckPage implements OnInit, OnDestroy { this.syncAllPending(); this.pycon.fetchCheckInProducts().then((data) => { data.subscribe(redeemable => { - this.redeemable_products = redeemable?.redeemable_products; - this.redeemable_categories = redeemable?.redeemable_categories; + // /check_in/redeemable/ returns the union of every redeemable + // category (sessions + swag) and CategorySerializer omits + // render_type, so we have to discriminate by name. Door check + // is for sessions/events only — drop the merch categories and + // any products hanging off them. Long-term fix: expose + // render_type (==10 for presentations) on the API. + const categories = (redeemable?.redeemable_categories ?? []) + .filter(c => !/shirt|swag/i.test(c?.name ?? '')); + const keepIds = new Set(categories.map(c => c.id)); + this.redeemable_categories = categories; + this.redeemable_products = (redeemable?.redeemable_products ?? []) + .filter(p => keepIds.has(p.category)); }) }) } diff --git a/src/app/pages/t-shirt-redemption/t-shirt-redemption.page.ts b/src/app/pages/t-shirt-redemption/t-shirt-redemption.page.ts index eb57180f..6738bfdb 100644 --- a/src/app/pages/t-shirt-redemption/t-shirt-redemption.page.ts +++ b/src/app/pages/t-shirt-redemption/t-shirt-redemption.page.ts @@ -214,8 +214,18 @@ export class TShirtRedemptionPage implements OnInit, OnDestroy { this.ios = this.config.get('mode') === `ios`; this.pycon.fetchCheckInProducts().then((data) => { data.subscribe(redeemable => { - this.redeemable_products = redeemable?.redeemable_products; - this.redeemable_categories = redeemable?.redeemable_categories; + // /check_in/redeemable/ returns the union of every redeemable + // category (sessions + swag) and CategorySerializer omits + // render_type, so we have to discriminate by name. Swag pickup + // only redeems merch — keep T-Shirt categories (and any + // future "swag-*" naming) and drop the rest. Long-term fix: + // expose render_type on the API. + const categories = (redeemable?.redeemable_categories ?? []) + .filter(c => /shirt|swag/i.test(c?.name ?? '')); + const keepIds = new Set(categories.map(c => c.id)); + this.redeemable_categories = categories; + this.redeemable_products = (redeemable?.redeemable_products ?? []) + .filter(p => keepIds.has(p.category)); }) }) }