From 3e13046706725cd7d9470010b9cfc057fca7e4a5 Mon Sep 17 00:00:00 2001 From: SoXX Date: Fri, 9 Aug 2024 22:44:55 +0200 Subject: [PATCH] fix(query): added conditions added the condition for the id --- pkg/database/source.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/database/source.go b/pkg/database/source.go index d9d1db5..d808b74 100644 --- a/pkg/database/source.go +++ b/pkg/database/source.go @@ -70,7 +70,7 @@ func GetUserSourceByID(ctx context.Context, id models.UserSourceID) (models.User return models.UserSource{}, &otterError.EntityValidationFailed{Reason: otterError.UserSourceIDToShort} } - result := client.WithContext(ctx).First(&user, id) + result := client.WithContext(ctx).First(&user, "id = ?", id) if result.Error != nil { if errors.Is(result.Error, gorm.ErrRecordNotFound) { return models.UserSource{}, &otterError.Database{Reason: otterError.NoDataFound}