diff --git a/app/collections_routes.py b/app/collections_routes.py index 81c96f9..2cf1ada 100644 --- a/app/collections_routes.py +++ b/app/collections_routes.py @@ -44,7 +44,7 @@ class CollectionIn(BaseModel): @router.get("/collections") async def list_collections(ident=Depends(require_token), db=Depends(get_db)): rows = (await db.execute(text(""" - SELECT id, name, color, priority, (is_active = 1 OR is_active = true) AS is_active, + SELECT id, name, color, priority, (is_active::int <> 0) AS is_active, crate_ids, style_ids, genre_ids, price_min::float, price_max::float, year_min, year_max FROM virtual_collection ORDER BY priority DESC, name """))).mappings() @@ -157,7 +157,7 @@ async def locate(release_id: int | None = Query(None), sku: str | None = Query(N cols = (await db.execute(text(""" SELECT id, name, color, crate_ids, genre_ids, style_ids, price_min::float AS pmin, price_max::float AS pmax, year_min, year_max - FROM virtual_collection WHERE is_active = 1 OR is_active = true ORDER BY priority DESC, name + FROM virtual_collection WHERE is_active::int <> 0 ORDER BY priority DESC, name """))).mappings() for c in cols: gmin, gmax = c["pmin"], c["pmax"]