🐛 Fix shuffle recommendation

This commit is contained in:
LittleSheep 2024-07-24 14:29:43 +08:00
parent 93251c05f4
commit 1925f26f16

View File

@ -2,6 +2,7 @@ package api
import (
"fmt"
"git.solsynth.dev/hydrogen/interactive/pkg/internal/database"
"git.solsynth.dev/hydrogen/interactive/pkg/internal/services"
"github.com/gofiber/fiber/v2"
@ -63,7 +64,7 @@ func listRecommendationShuffle(c *fiber.Ctx) error {
return fiber.NewError(fiber.StatusInternalServerError, err.Error())
}
items, err := services.ListPost(tx, take, offset, gorm.Expr("RAND()"))
items, err := services.ListPost(tx, take, offset, gorm.Expr("RANDOM()"))
if err != nil {
return fiber.NewError(fiber.StatusBadRequest, err.Error())
}