From e8fb9a21d3b08fe2dd147d46c4bacae7e551a38e Mon Sep 17 00:00:00 2001 From: Max Wofford Date: Wed, 8 Jan 2025 18:20:57 -0500 Subject: [PATCH] Don't show unlisted items on the shop --- src/app/harbor/shop/shop-utils.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/harbor/shop/shop-utils.ts b/src/app/harbor/shop/shop-utils.ts index e15a1b10..d444213d 100644 --- a/src/app/harbor/shop/shop-utils.ts +++ b/src/app/harbor/shop/shop-utils.ts @@ -40,13 +40,17 @@ export async function getShop(): Promise { return } const person = await getSelfPerson(session.slackId) + const filter = person.fields.academy_completed + ? '{enabled_main_game}' + : '{enabled_high_seas}' return new Promise((resolve, reject) => { base()('shop_items') .select({ - filterByFormula: person.fields.academy_completed - ? '{enabled_main_game}' - : '{enabled_high_seas}', + filterByFormula: `AND( + unlisted = FALSE(), + ${filter} = TRUE() + )`, sort: [{ field: 'tickets_us', direction: 'asc' }], }) .eachPage(