Upgraded to latest aero version
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
@ -14,11 +15,11 @@ import (
|
||||
)
|
||||
|
||||
// Get admin page.
|
||||
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, "/")
|
||||
}
|
||||
|
||||
// // CPU
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
const maxReports = 80
|
||||
|
||||
// ClientErrors shows client-side errors.
|
||||
func ClientErrors(ctx *aero.Context) string {
|
||||
func ClientErrors(ctx aero.Context) error {
|
||||
reports := arn.AllClientErrorReports()
|
||||
|
||||
sort.Slice(reports, func(i, j int) bool {
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
// PaymentHistory ...
|
||||
func PaymentHistory(ctx *aero.Context) string {
|
||||
func PaymentHistory(ctx aero.Context) error {
|
||||
user := utils.GetUser(ctx)
|
||||
|
||||
if user == nil {
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
// PurchaseHistory ...
|
||||
func PurchaseHistory(ctx *aero.Context) string {
|
||||
func PurchaseHistory(ctx aero.Context) error {
|
||||
user := utils.GetUser(ctx)
|
||||
|
||||
if user == nil {
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
// UserRegistrations ...
|
||||
func UserRegistrations(ctx *aero.Context) string {
|
||||
func UserRegistrations(ctx aero.Context) error {
|
||||
user := utils.GetUser(ctx)
|
||||
|
||||
if user == nil {
|
||||
|
@ -4,6 +4,6 @@ import "github.com/aerogo/aero"
|
||||
import "github.com/animenotifier/notify.moe/components"
|
||||
|
||||
// WebDev ...
|
||||
func WebDev(ctx *aero.Context) string {
|
||||
func WebDev(ctx aero.Context) error {
|
||||
return ctx.HTML(components.WebDev())
|
||||
}
|
||||
|
Reference in New Issue
Block a user