Upgraded to latest aero version

This commit is contained in:
2019-06-01 13:55:49 +09:00
parent ae591e5e7e
commit 28db818c37
196 changed files with 645 additions and 593 deletions

View File

@ -6,11 +6,12 @@ import (
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
"github.com/animenotifier/notify.moe/middleware"
"github.com/animenotifier/notify.moe/utils"
)
// Get a single AMV.
func Get(ctx *aero.Context) string {
func Get(ctx aero.Context) error {
id := ctx.Get("id")
amv, err := arn.GetAMV(id)
user := utils.GetUser(ctx)
@ -19,6 +20,7 @@ func Get(ctx *aero.Context) string {
return ctx.Error(http.StatusNotFound, "AMV not found", err)
}
ctx.Data = getOpenGraph(ctx, amv)
customCtx := ctx.(*middleware.OpenGraphContext)
customCtx.OpenGraph = getOpenGraph(ctx, amv)
return ctx.HTML(components.AMVPage(amv, user))
}