22 lines
445 B
Go
Raw Normal View History

2016-11-19 14:54:31 +00:00
package genre
import (
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
2017-11-12 10:18:16 +00:00
"github.com/animenotifier/notify.moe/utils"
2016-11-19 14:54:31 +00:00
)
// Get ...
func Get(ctx *aero.Context) string {
2017-11-12 10:18:16 +00:00
user := utils.GetUser(ctx)
2016-11-19 14:54:31 +00:00
genreName := ctx.Get("name")
2016-11-19 19:53:33 +00:00
genre, err := arn.GetGenre(genreName)
2016-11-19 14:54:31 +00:00
if err != nil {
return ctx.Error(404, "Genre not found", err)
2016-11-19 14:54:31 +00:00
}
2017-11-12 10:18:16 +00:00
return ctx.HTML(components.Genre(genre, user))
2016-11-19 14:54:31 +00:00
}