Made link a single word

This commit is contained in:
2022-01-24 15:44:12 +01:00
parent 000f030d9a
commit b358e1a97c
7 changed files with 37 additions and 20 deletions

View File

@@ -1,10 +1,12 @@
package api
import (
"TheAdversary/config"
"TheAdversary/database"
"TheAdversary/schema"
"encoding/json"
"net/http"
"path"
"strconv"
"strings"
)
@@ -70,6 +72,7 @@ func Search(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.Prefix, "article", summary.Link)
articleSummaries[i] = summary
}