24 lines
496 B
Go
Raw Normal View History

2017-07-13 08:23:20 +02:00
package character
import (
"net/http"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
2017-11-19 15:15:44 +01:00
"github.com/animenotifier/notify.moe/utils"
2017-07-13 08:23:20 +02:00
)
// Get character.
func Get(ctx *aero.Context) string {
2017-11-19 15:15:44 +01:00
user := utils.GetUser(ctx)
2017-07-13 08:23:20 +02:00
id := ctx.Get("id")
character, err := arn.GetCharacter(id)
if err != nil {
return ctx.Error(http.StatusNotFound, "Character not found", err)
}
2017-11-19 15:15:44 +01:00
return ctx.HTML(components.CharacterDetails(character, user))
2017-07-13 08:23:20 +02:00
}