🐛 Ah bug fixes

This commit is contained in:
LittleSheep 2025-06-02 21:34:47 +08:00
parent 9b7a3be5c9
commit 2be92d503e

View File

@ -36,7 +36,7 @@ public class FileReferenceMigrationService(AppDatabase db)
.Include(p => p.OutdatedAttachments) .Include(p => p.OutdatedAttachments)
.ToListAsync(); .ToListAsync();
var attachmentsId = posts.SelectMany(p => p.OutdatedAttachments.Select(a => a.Id)).ToList(); var attachmentsId = posts.SelectMany(p => p.Attachments.Select(a => a.Id)).ToList();
var attachments = var attachments =
await db.Files.Where(f => attachmentsId.Contains(f.Id)).ToDictionaryAsync(x => x.Id); await db.Files.Where(f => attachmentsId.Contains(f.Id)).ToDictionaryAsync(x => x.Id);