feat: add delete advert functionality to SQLiteHandler and API endpoints

This commit is contained in:
Lloyd
2025-11-24 21:27:12 +00:00
parent 582dba8b7a
commit 788db09b59
4 changed files with 58 additions and 6 deletions
@@ -812,4 +812,13 @@ class SQLiteHandler:
return cursor.rowcount > 0
except Exception as e:
logger.error(f"Failed to delete transport key: {e}")
return False
def delete_advert(self, advert_id: int) -> bool:
try:
with sqlite3.connect(self.sqlite_path) as conn:
cursor = conn.execute("DELETE FROM adverts WHERE id = ?", (advert_id,))
return cursor.rowcount > 0
except Exception as e:
logger.error(f"Failed to delete advert: {e}")
return False