This commit is contained in:
Aodhan
2025-07-08 23:45:25 +01:00
parent 66bf325459
commit b9b47c96f6

View File

@@ -179,7 +179,8 @@ async def items(
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)
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
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"
)
result = await session.execute(q, params)