Skip to content

Commit

Permalink
🍺 Forgot apply the same code as create sticker is edit sticker
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleSheep2Code committed Aug 3, 2024
1 parent c381b53 commit dc57261
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/internal/server/api/stickers_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ func updateSticker(c *fiber.Ctx) error {

if strings.SplitN(attachment.MimeType, "/", 2)[0] != "image" {
return fiber.NewError(fiber.StatusBadRequest, "sticker attachment must be an image")
} else if width, ok := attachment.Metadata["width"].(float64); !ok {
} else if width, ok := attachment.Metadata["width"]; !ok {
return fiber.NewError(fiber.StatusBadRequest, "sticker attachment must has width metadata")
} else if height, ok := attachment.Metadata["height"].(float64); !ok {
} else if height, ok := attachment.Metadata["height"]; !ok {
return fiber.NewError(fiber.StatusBadRequest, "sticker attachment must has height metadata")
} else if width != 28 || height != 28 {
} else if fmt.Sprint(width) != fmt.Sprint(28) || fmt.Sprint(height) != fmt.Sprint(28) {
return fiber.NewError(fiber.StatusBadRequest, "sticker attachment must be a 28x28 image")
}

Expand Down

0 comments on commit dc57261

Please sign in to comment.