From 2f8f79992637de98f91f0f56cfb10d03c11dac15 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 24 Jul 2024 14:37:21 +0800 Subject: [PATCH] :bug: Fix query statement in shuffle --- pkg/internal/server/api/recommendation_api.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/internal/server/api/recommendation_api.go b/pkg/internal/server/api/recommendation_api.go index d92b192..583567a 100644 --- a/pkg/internal/server/api/recommendation_api.go +++ b/pkg/internal/server/api/recommendation_api.go @@ -6,7 +6,6 @@ import ( "git.solsynth.dev/hydrogen/interactive/pkg/internal/database" "git.solsynth.dev/hydrogen/interactive/pkg/internal/services" "github.com/gofiber/fiber/v2" - "gorm.io/gorm" ) func listRecommendationDefault(c *fiber.Ctx) error { @@ -64,7 +63,7 @@ func listRecommendationShuffle(c *fiber.Ctx) error { return fiber.NewError(fiber.StatusInternalServerError, err.Error()) } - items, err := services.ListPost(tx, take, offset, gorm.Expr("RANDOM()")) + items, err := services.ListPost(tx, take, offset, "RANDOM()") if err != nil { return fiber.NewError(fiber.StatusBadRequest, err.Error()) }