🐛 Fix getting count of stickers in pack

This commit is contained in:
2024-09-25 22:28:08 +08:00
parent f7ab3bfb18
commit fa997a19a1
4 changed files with 2 additions and 47 deletions

View File

@@ -54,7 +54,8 @@ func listStickers(c *fiber.Ctx) error {
}
var count int64
if err := database.C.Model(&models.Sticker{}).Count(&count).Error; err != nil {
countTx := tx
if err := countTx.Model(&models.Sticker{}).Count(&count).Error; err != nil {
return fiber.NewError(fiber.StatusInternalServerError, err.Error())
}