Fixed bug not showing correct issue in RSS feed

This commit is contained in:
Jason Streifling 2024-03-28 07:41:11 +01:00
parent 34e9e9edd5
commit 77a90cb4f1
2 changed files with 4 additions and 3 deletions

View File

@ -50,7 +50,7 @@ func main() {
mux.HandleFunc("GET /edit-user/", view.EditUser(db, store))
mux.HandleFunc("GET /hub/", view.ShowHub(db, store))
mux.HandleFunc("GET /logout/", view.Logout(store))
mux.HandleFunc("GET /publish-issue/", view.PublishLatestIssue(db))
mux.HandleFunc("GET /publish-issue/", view.PublishLatestIssue(db, store))
mux.HandleFunc("GET /rejected-articles/", view.ShowRejectedArticles(db, store))
mux.HandleFunc("GET /rss/", view.ShowRSS(
db,

View File

@ -105,7 +105,7 @@ func (db *DB) GetArticle(id int64) (*Article, error) {
func (db *DB) GetCertainArticles(published, rejected bool) ([]*Article, error) {
query := `
SELECT id, title, created, description, content, author_id
SELECT id, title, created, description, content, author_id, issue_id
FROM articles
WHERE published = ?
AND rejected = ?
@ -121,7 +121,8 @@ func (db *DB) GetCertainArticles(published, rejected bool) ([]*Article, error) {
var created []byte
if err = rows.Scan(&article.ID, &article.Title, &created,
&article.Description, &article.Content, &article.AuthorID); err != nil {
&article.Description, &article.Content, &article.AuthorID,
&article.IssueID); err != nil {
return nil, fmt.Errorf("error scanning article row: %v", err)
}