Skip to content

Commit e94d1ed

Browse files
authored
fix: getModByIDOrReference not loading tags (#13)
1 parent baacb20 commit e94d1ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

db/postgres/mod.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func GetModByIDOrReference(ctx context.Context, modIDOrReference string) *Mod {
270270
}
271271

272272
var mod Mod
273-
DBCtx(ctx).Find(&mod, "mod_reference = ? OR id = ?", modIDOrReference, modIDOrReference)
273+
DBCtx(ctx).Preload("Tags").Find(&mod, "mod_reference = ? OR id = ?", modIDOrReference, modIDOrReference)
274274

275275
if mod.ID == "" {
276276
return nil
@@ -325,7 +325,7 @@ func GetModsByIDOrReference(ctx context.Context, modIDOrReferences []string) []M
325325
}
326326

327327
var mods []Mod
328-
DBCtx(ctx).Find(&mods, "mod_reference IN ? OR id IN ?", modIDOrReferences, modIDOrReferences)
328+
DBCtx(ctx).Preload("Tags").Find(&mods, "mod_reference IN ? OR id IN ?", modIDOrReferences, modIDOrReferences)
329329

330330
dbCache.Set(cacheKey, mods, cache.DefaultExpiration)
331331

0 commit comments

Comments
 (0)