Skip to content

Commit

Permalink
Merge pull request #1085 from hackclub/unlisted-shop-items
Browse files Browse the repository at this point in the history
Don't show unlisted items on the shop
  • Loading branch information
maxwofford authored Jan 9, 2025
2 parents 52f7e3d + e8fb9a2 commit 3e4ba6b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/app/harbor/shop/shop-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,17 @@ export async function getShop(): Promise<ShopItem[]> {
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(
Expand Down

0 comments on commit 3e4ba6b

Please sign in to comment.