🐛 Bug fixes

This commit is contained in:
2025-04-25 23:13:15 +08:00
parent c8e9f73746
commit 38b7e8c1a1
2 changed files with 23 additions and 1 deletions

View File

@ -16,7 +16,12 @@ public class AccountController(AppDatabase db, FileService fs, IMemoryCache memC
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult<Account?>> GetByName(string name)
{
var account = await db.Accounts.Where(a => a.Name == name).FirstOrDefaultAsync();
var account = await db.Accounts
.Include(e => e.Profile)
.Include(e => e.Profile.Picture)
.Include(e => e.Profile.Background)
.Where(a => a.Name == name)
.FirstOrDefaultAsync();
return account is null ? new NotFoundResult() : account;
}