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

@@ -58,7 +58,7 @@ func assetsGet(w http.ResponseWriter, r *http.Request) {
request.Find(&assets)
for _, asset := range assets {
asset.Link = path.Join(config.Path, "assets", asset.Link)
asset.Link = path.Join("/", config.SubPath, "assets", asset.Link)
}
w.WriteHeader(http.StatusOK)
@@ -101,7 +101,7 @@ func assetsPost(w http.ResponseWriter, r *http.Request) {
json.NewEncoder(w).Encode(schema.Asset{
Id: tmpDatabaseSchema.Id,
Name: tmpDatabaseSchema.Name,
Link: path.Join(config.Path, "assets", tmpDatabaseSchema.Link),
Link: path.Join("/", config.SubPath, "assets", tmpDatabaseSchema.Link),
})
}
}