🐛 Fix chat room missing realms info

This commit is contained in:
2025-12-21 22:39:59 +08:00
parent a49d485943
commit 2aff62c64f
3 changed files with 33 additions and 5 deletions

View File

@@ -8,7 +8,7 @@ namespace DysonNetwork.Sphere.Chat;
[ApiController]
[Route("/api/realms/{slug}")]
public class RealmChatController(AppDatabase db, RemoteRealmService rs) : ControllerBase
public class RealmChatController(AppDatabase db, ChatRoomService crs, RemoteRealmService rs) : ControllerBase
{
[HttpGet("chat")]
[Authorize]
@@ -28,6 +28,8 @@ public class RealmChatController(AppDatabase db, RemoteRealmService rs) : Contro
var chatRooms = await db.ChatRooms
.Where(c => c.RealmId == realm.Id)
.ToListAsync();
chatRooms = await crs.LoadChatRealms(chatRooms);
return Ok(chatRooms);
}