Achieve consistency by using a single Image type

This commit is contained in:
2019-06-04 13:37:59 +09:00
parent 3d526f9198
commit dd36c852d3
14 changed files with 21 additions and 20 deletions

View File

@ -7,8 +7,8 @@ import (
"github.com/animenotifier/notify.moe/utils"
)
// Cover handles the cover image upload.
func Cover(ctx aero.Context) error {
// UserCover handles the cover image upload.
func UserCover(ctx aero.Context) error {
user := utils.GetUser(ctx)
if user == nil {

View File

@ -7,8 +7,8 @@ import (
"github.com/animenotifier/notify.moe/utils"
)
// Avatar handles the avatar upload.
func Avatar(ctx aero.Context) error {
// UserImage handles the avatar upload.
func UserImage(ctx aero.Context) error {
user := utils.GetUser(ctx)
if user == nil {
@ -23,7 +23,7 @@ func Avatar(ctx aero.Context) error {
}
// Set avatar file
err = user.SetAvatarBytes(data)
err = user.SetImageBytes(data)
if err != nil {
return ctx.Error(http.StatusInternalServerError, "Invalid image format", err)