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

@ -1,6 +1,7 @@
package editor
import (
"net/http"
"strconv"
"github.com/aerogo/aero"
@ -10,11 +11,11 @@ import (
)
// Get ...
func Get(ctx *aero.Context) string {
func Get(ctx aero.Context) error {
user := utils.GetUser(ctx)
if user == nil || (user.Role != "admin" && user.Role != "editor") {
return ctx.Redirect("/")
return ctx.Redirect(http.StatusFound, "/")
}
ignoreDifferences := arn.FilterIgnoreAnimeDifferences(func(entry *arn.IgnoreAnimeDifference) bool {
@ -43,5 +44,5 @@ func Get(ctx *aero.Context) string {
scoreTitle += objectType + ": " + strconv.Itoa(score) + "\n"
}
return ctx.HTML(components.Editor(ctx.URI(), score, scoreTitle, scoreTypes, user))
return ctx.HTML(components.Editor(ctx.Path(), score, scoreTitle, scoreTypes, user))
}