fix(query): added conditions

added the condition for the id
This commit is contained in:
SoXX 2024-08-09 22:44:55 +02:00
parent 85d7905e8a
commit 3e13046706

View File

@ -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}