From 2fb29284fb849bea494ba90c05dd3dea87ec7151 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 10 Jun 2025 00:39:00 +0800 Subject: [PATCH] :bug: Fixes on notify level --- DysonNetwork.Sphere/Chat/ChatRoomController.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/DysonNetwork.Sphere/Chat/ChatRoomController.cs b/DysonNetwork.Sphere/Chat/ChatRoomController.cs index 133e889..23ba05d 100644 --- a/DysonNetwork.Sphere/Chat/ChatRoomController.cs +++ b/DysonNetwork.Sphere/Chat/ChatRoomController.cs @@ -520,7 +520,7 @@ public class ChatRoomController( .FirstOrDefaultAsync(); if (member is null) return NotFound(); - member.JoinedAt = NodaTime.Instant.FromDateTimeUtc(DateTime.UtcNow); + member.JoinedAt = Instant.FromDateTimeUtc(DateTime.UtcNow); db.Update(member); await db.SaveChangesAsync(); _ = crs.PurgeRoomMembersCache(roomId); @@ -563,7 +563,6 @@ public class ChatRoomController( [Authorize] public async Task> UpdateChatMemberNotify( Guid roomId, - Guid memberId, [FromBody] ChatMemberNotifyRequest request ) { @@ -575,7 +574,7 @@ public class ChatRoomController( if (chatRoom is null) return NotFound(); var targetMember = await db.ChatMembers - .Where(m => m.AccountId == memberId && m.ChatRoomId == roomId) + .Where(m => m.AccountId == currentUser.Id && m.ChatRoomId == roomId) .FirstOrDefaultAsync(); if (targetMember is null) return BadRequest("You have not joined this chat room."); if (request.NotifyLevel is not null)