mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-08-07 09:23:06 +02:00
feat: add delete advert functionality to SQLiteHandler and API endpoints
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user