fix(db): Delete unused value of name

This commit is contained in:
Black_Raven committed 2026-07-26 19:07:21 +03:00
1 parent 30c81e5aa5
commit 0a6418d84d
4 files changed
+39 -23

No files matched your search

+5 -6
View File
@@ -141,7 +141,7 @@ def get_product_by_id(product_id: int, db_name: str = 'pipe_store.db') -> Option
try:
cursor.execute("""
SELECT p.id, p.name, p.full_name, p.description,
SELECT p.id, p.name, p.description,
p.diameter, p.wall_thickness, p.length, p.color,
p.application_type, p.stiffness_class, p.image_path,
p.created_at, p.category_id
@@ -192,7 +192,6 @@ def get_product_by_id(product_id: int, db_name: str = 'pipe_store.db') -> Option
return {
"id": row['id'],
"name": row['name'],
"full_name": row['full_name'],
"description": full_description,
"price": None,
"categoryId": row['category_id'],
@@ -239,8 +238,8 @@ def generate_full_description(row: sqlite3.Row) -> str:
"""Сгенерировать полное описание товара"""
parts = []
if row['full_name']:
parts.append(row['full_name'])
if row['name']:
parts.append(row['name'])
if row['description']:
parts.append(row['description'])
@@ -264,7 +263,7 @@ def generate_full_description(row: sqlite3.Row) -> str:
def get_product_list(page=1, limit=100, category_id=None):
"""
Получить список товаров с пагинацией (без фильтров).
Возвращает список словарей с полями id, full_name, description.
Возвращает список словарей с полями id, name, description.
"""
conn = None
try:
@@ -278,7 +277,7 @@ def get_product_list(page=1, limit=100, category_id=None):
for row in rows:
products.append({
'id': row['id'],
'full_name': row['full_name'],
'name': row['name'],
'description': row['description']
})
return products