This commit is contained in:
Jason Streifling 2024-09-13 05:12:57 +02:00
parent c777a77824
commit 38ef7b80d5

View File

@ -269,14 +269,13 @@ func (db *DB) AddArticleToCurrentIssue(id int64) error {
func (db *DB) DeleteArticle(id int64) error { func (db *DB) DeleteArticle(id int64) error {
articlesTagsQuery := "DELETE FROM articles_tags WHERE article_id = ?" articlesTagsQuery := "DELETE FROM articles_tags WHERE article_id = ?"
articlesQuery := "DELETE FROM articles WHERE id = ?"
_, err := db.Exec(articlesTagsQuery, id) _, err := db.Exec(articlesTagsQuery, id)
if err != nil { if err != nil {
return fmt.Errorf("error deleting article %v from DB: %v", id, err) return fmt.Errorf("error deleting article %v from DB: %v", id, err)
} }
articlesQuery := "DELETE FROM articles WHERE id = ?"
_, err = db.Exec(articlesQuery, id) _, err = db.Exec(articlesQuery, id)
if err != nil { if err != nil {
return fmt.Errorf("error deleting article %v from DB: %v", id, err) return fmt.Errorf("error deleting article %v from DB: %v", id, err)