mirror of
https://github.com/velocitatem/PHANTOM.git
synced 2026-05-31 08:33:36 +00:00
chore: clean up product display in hotel and cleaner interfacing
This commit is contained in:
@@ -290,8 +290,14 @@ async def get_products(
|
||||
query = supabase.table(table).select('*')
|
||||
|
||||
# filter by exact date_index if provided
|
||||
# dateIndex from frontend is days from today, convert to days since epoch
|
||||
if dateIndex is not None:
|
||||
query = query.eq('date_index', dateIndex)
|
||||
from datetime import datetime
|
||||
epoch = datetime(1970, 1, 1)
|
||||
today = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
today_index = int((today - epoch).total_seconds() / 86400)
|
||||
actual_date_index = today_index + dateIndex
|
||||
query = query.eq('date_index', actual_date_index)
|
||||
|
||||
response = query.execute()
|
||||
results = response.data
|
||||
|
||||
Reference in New Issue
Block a user