Deleted utils.GetUser
This commit is contained in:
@ -6,12 +6,11 @@ import (
|
||||
"github.com/animenotifier/notify.moe/arn"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
)
|
||||
|
||||
// AMVFile handles the video upload for AMV files.
|
||||
func AMVFile(ctx aero.Context) error {
|
||||
user := utils.GetUser(ctx)
|
||||
user := arn.GetUserFromContext(ctx)
|
||||
amvID := ctx.Get("id")
|
||||
|
||||
if user == nil {
|
||||
|
@ -6,12 +6,11 @@ import (
|
||||
"github.com/animenotifier/notify.moe/arn"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
)
|
||||
|
||||
// AnimeImage handles the anime image upload.
|
||||
func AnimeImage(ctx aero.Context) error {
|
||||
user := utils.GetUser(ctx)
|
||||
user := arn.GetUserFromContext(ctx)
|
||||
animeID := ctx.Get("id")
|
||||
|
||||
if user == nil || (user.Role != "editor" && user.Role != "admin") {
|
||||
|
@ -6,12 +6,11 @@ import (
|
||||
"github.com/animenotifier/notify.moe/arn"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
)
|
||||
|
||||
// CharacterImage handles the character image upload.
|
||||
func CharacterImage(ctx aero.Context) error {
|
||||
user := utils.GetUser(ctx)
|
||||
user := arn.GetUserFromContext(ctx)
|
||||
characterID := ctx.Get("id")
|
||||
|
||||
if user == nil || (user.Role != "editor" && user.Role != "admin") {
|
||||
|
@ -5,12 +5,11 @@ import (
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/notify.moe/arn"
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
)
|
||||
|
||||
// GroupImage handles the group image upload.
|
||||
func GroupImage(ctx aero.Context) error {
|
||||
user := utils.GetUser(ctx)
|
||||
user := arn.GetUserFromContext(ctx)
|
||||
groupID := ctx.Get("id")
|
||||
|
||||
if user == nil || (user.Role != "editor" && user.Role != "admin") {
|
||||
|
@ -4,12 +4,12 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
"github.com/animenotifier/notify.moe/arn"
|
||||
)
|
||||
|
||||
// UserCover handles the cover image upload.
|
||||
func UserCover(ctx aero.Context) error {
|
||||
user := utils.GetUser(ctx)
|
||||
user := arn.GetUserFromContext(ctx)
|
||||
|
||||
if user == nil {
|
||||
return ctx.Error(http.StatusUnauthorized, "Not logged in")
|
||||
|
@ -4,12 +4,12 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
"github.com/animenotifier/notify.moe/arn"
|
||||
)
|
||||
|
||||
// UserImage handles the avatar upload.
|
||||
func UserImage(ctx aero.Context) error {
|
||||
user := utils.GetUser(ctx)
|
||||
user := arn.GetUserFromContext(ctx)
|
||||
|
||||
if user == nil {
|
||||
return ctx.Error(http.StatusUnauthorized, "Not logged in")
|
||||
|
Reference in New Issue
Block a user