Align shop and inventory data with database schema changes

Update shop GET endpoint to filter by `enabled` instead of `available`. Correct user inventory query to select `item_data` from `shop_items` table, replacing the deprecated `value` column.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: aed2e46d-25bb-4b73-81a1-bb9e8437c261
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 411c419b-dfbc-456d-b53c-0a81a700fbda
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3bdfff67-975a-46ad-9845-fbb6b4a4c4b5/aed2e46d-25bb-4b73-81a1-bb9e8437c261/oWFvNCu
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
sirpiglr 2025-12-09 04:12:46 +00:00
parent 4e9873d76a
commit 50645175da

View file

@ -359,7 +359,7 @@ function createWebServer(discordClient, supabase, options = {}) {
.from('shop_items') .from('shop_items')
.select('*') .select('*')
.eq('guild_id', guildId) .eq('guild_id', guildId)
.eq('available', true) .eq('enabled', true)
.order('price', { ascending: true }); .order('price', { ascending: true });
res.json({ items: items || [] }); res.json({ items: items || [] });
@ -395,7 +395,7 @@ function createWebServer(discordClient, supabase, options = {}) {
.from('user_inventory') .from('user_inventory')
.select(` .select(`
*, *,
shop_items (name, description, item_type, value) shop_items (name, description, item_type, item_data)
`) `)
.eq('user_id', link.user_id) .eq('user_id', link.user_id)
.eq('guild_id', guildId); .eq('guild_id', guildId);