From 714cdd9aaf31ff44181195c752c0098d583dee1f Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Sun, 25 Aug 2024 10:51:09 +0200 Subject: [PATCH] Also delete article from RSS feed --- cmd/frontend/articles.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmd/frontend/articles.go b/cmd/frontend/articles.go index b5833fa..5fc9ee6 100644 --- a/cmd/frontend/articles.go +++ b/cmd/frontend/articles.go @@ -582,6 +582,18 @@ func DeleteArticle(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFunc { return } + feed, err := b.GenerateRSS(db, c.Title, c.Link, c.Description) + if err != nil { + log.Println(err) + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + if err = b.SaveRSS(c.RSSFile, feed); err != nil { + log.Println(err) + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + tmpl, err := template.ParseFiles(c.WebDir + "/templates/hub.html") tmpl = template.Must(tmpl, err) tmpl.ExecuteTemplate(w, "page-content", session.Values["role"].(int))