Created func for minimum spec for rss and article structs, thereby crushing an annoying bug that was caused by not initializing channels but waiting for messages to go through them

This commit is contained in:
2024-03-02 00:28:42 +01:00
parent 4e2cae74bb
commit 2da17014e4
4 changed files with 70 additions and 46 deletions

View File

@ -60,7 +60,7 @@ func FinishArticle(l *data.ArticleList) http.HandlerFunc {
func ShowUnpublishedArticles(l *data.ArticleList) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
template.Must(template.ParseFiles("web/templates/unpublished-articles.html")).ExecuteTemplate(w, "page-content", l.List)
template.Must(template.ParseFiles("web/templates/unpublished-articles.html")).ExecuteTemplate(w, "page-content", l.Get())
}
}
@ -73,7 +73,7 @@ func ReviewArticle(l *data.ArticleList) http.HandlerFunc {
return
}
for _, article := range l.List() {
for _, article := range l.Get() {
if article.UUID == uuid {
template.Must(template.ParseFiles("web/templates/to-be-published.html")).ExecuteTemplate(w, "page-content", article)
return

View File

@ -10,7 +10,7 @@ import (
func ShowRSS(f *data.Feed) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
feed := f.Show()
feed := f.Get()
rss, err := feed.ToRss()
if err != nil {
log.Println(err)