even more frontend stuff

This commit is contained in:
sam 2024-11-25 17:35:24 +01:00
parent 8bba5f6137
commit c0bb76580d
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
33 changed files with 796 additions and 178 deletions

View file

@ -303,8 +303,8 @@ public class MembersController(
.SetProperty(u => u.LastActive, clock.GetCurrentInstant())
);
// Re-fetch member to fetch the new sid
var updatedMember = await db.ResolveMemberAsync(CurrentUser!.Id, memberRef);
return Ok(memberRenderer.RenderMember(updatedMember, CurrentToken));
// Fetch the new sid then pass that to RenderMember
var newSid = await db.Members.Where(m => m.Id == member.Id).Select(m => m.Sid).FirstAsync();
return Ok(memberRenderer.RenderMember(member, CurrentToken, newSid));
}
}

View file

@ -346,13 +346,20 @@ public class UsersController(
.SetProperty(u => u.LastActive, clock.GetCurrentInstant())
);
// Get the user's new sid
var newSid = await db
.Users.Where(u => u.Id == CurrentUser.Id)
.Select(u => u.Sid)
.FirstAsync();
var user = await db.ResolveUserAsync(CurrentUser.Id);
return Ok(
await userRenderer.RenderUserAsync(
user,
CurrentUser,
CurrentUser,
CurrentToken,
renderMembers: false
renderMembers: false,
overrideSid: newSid
)
);
}