🐛 Fixes bugs

This commit is contained in:
LittleSheep 2025-05-05 01:49:59 +08:00
parent 7e7c8fe556
commit 2206676214
2 changed files with 6 additions and 5 deletions

View File

@ -97,7 +97,7 @@ public class AccountController(
},
expiredAt: SystemClock.Instance.GetCurrentInstant().Plus(Duration.FromDays(7))
);
spells.NotifyMagicSpell(spell);
await spells.NotifyMagicSpell(spell, true);
return account;
}

View File

@ -41,7 +41,8 @@ public class PostController(AppDatabase db, PostService ps, RelationshipService
var postsId = posts.Select(e => e.Id).ToList();
var reactionMaps = await ps.GetPostReactionMapBatch(postsId);
foreach (var post in posts)
post.ReactionsCount = reactionMaps[post.Id];
post.ReactionsCount =
reactionMaps.TryGetValue(post.Id, out var count) ? count : new Dictionary<string, int>();
Response.Headers["X-Total"] = totalCount.ToString();