Multiple fixes and added article get endpoint for authors

This commit is contained in:
2022-02-02 16:00:56 +01:00
parent 6a6283f781
commit 3c8fd32345
11 changed files with 141 additions and 20 deletions

View File

@@ -35,7 +35,7 @@ func Recent(w http.ResponseWriter, r *http.Request) {
database.GetDB().Table("author").Where("id IN (?)", database.GetDB().Table("article_author").Select("author_id").Where("article_id = ?", summary.Id)).Find(&summary.Authors)
summary.Tags = []string{}
database.GetDB().Table("article_tag").Select("tag").Where("article_id = ?", summary.Id).Find(&summary.Tags)
summary.Link = path.Join(config.Path, "article", summary.Link)
summary.Link = path.Join("/", config.SubPath, "article", summary.Link)
articleSummaries[i] = summary
}