Fix
This commit is contained in:
@@ -179,7 +179,8 @@ async def items(
|
|||||||
|
|
||||||
where_sql = f"WHERE {' AND '.join(where_clauses)}" if where_clauses else ""
|
where_sql = f"WHERE {' AND '.join(where_clauses)}" if where_clauses else ""
|
||||||
|
|
||||||
join_sql = "FROM all_items a LEFT JOIN armor_items ai ON ai.id = a.id"
|
# Removed dependency on armor_items to avoid errors if table is absent
|
||||||
|
join_sql = "FROM all_items a"
|
||||||
|
|
||||||
# Total count for pagination (exclude limit/offset)
|
# Total count for pagination (exclude limit/offset)
|
||||||
count_params = {k: v for k, v in params.items() if k not in ("limit", "offset")}
|
count_params = {k: v for k, v in params.items() if k not in ("limit", "offset")}
|
||||||
@@ -190,7 +191,7 @@ async def items(
|
|||||||
|
|
||||||
# Main query
|
# Main query
|
||||||
q = text(
|
q = text(
|
||||||
f"SELECT a.id, a.name, a.icon_id, a.type_description, ai.jobs_description "
|
f"SELECT a.id, a.name, a.icon_id, a.type_description, NULL AS jobs_description "
|
||||||
f"{join_sql} {where_sql} ORDER BY a.id LIMIT :limit OFFSET :offset"
|
f"{join_sql} {where_sql} ORDER BY a.id LIMIT :limit OFFSET :offset"
|
||||||
)
|
)
|
||||||
result = await session.execute(q, params)
|
result = await session.execute(q, params)
|
||||||
|
|||||||
Reference in New Issue
Block a user