Добавил возможность удаления услуг в БД и UI панели администратора
This commit is contained in:
@@ -263,3 +263,11 @@ class DatabaseManager:
|
||||
""", (name.strip(), price.strip(), float(price_numeric), description.strip(), int(is_active), service_id.strip()))
|
||||
conn.commit()
|
||||
return cursor.rowcount > 0
|
||||
|
||||
def delete_service(self, service_id: str) -> bool:
|
||||
"""Удалить услугу из базы данных."""
|
||||
with self._get_connection() as conn:
|
||||
cursor = conn.cursor()
|
||||
cursor.execute("DELETE FROM services WHERE id = ?", (service_id.strip(),))
|
||||
conn.commit()
|
||||
return cursor.rowcount > 0
|
||||
|
||||
Reference in New Issue
Block a user