Sequels page is now linked on profiles

This commit is contained in:
2018-12-06 14:13:49 +09:00
parent 566b8f83cf
commit 7dfaa85a7a
8 changed files with 21 additions and 49 deletions

View File

@ -13,13 +13,20 @@ import (
// Sequels ...
func Sequels(ctx *aero.Context) string {
nick := ctx.Get("nick")
user := utils.GetUser(ctx)
if user == nil {
return ctx.Error(http.StatusUnauthorized, "Not logged in")
}
animeList := user.AnimeList()
viewUser, err := arn.GetUserByNick(nick)
if err != nil {
return ctx.Error(http.StatusNotFound, "User not found", err)
}
animeList := viewUser.AnimeList()
sequels := []*utils.AnimeWithRelatedAnime{}
for anime := range arn.StreamAnime() {
@ -56,5 +63,5 @@ func Sequels(ctx *aero.Context) string {
return aScore > bScore
})
return ctx.HTML(components.ExploreAnimeSequels(sequels, user))
return ctx.HTML(components.ExploreAnimeSequels(sequels, viewUser, user))
}