Send Logout Event If User Is Logged In

Fix Instances Of `RefreshUserList` Instead Of `RefreshUserLists`
This commit is contained in:
Alan Moon 2025-07-13 17:25:06 -07:00
parent bdbd00bb2a
commit c7409a90c5
2 changed files with 4 additions and 3 deletions

View File

@ -35,7 +35,7 @@ namespace qtc_api.Controllers
if(userDto != null)
{
var response = await _userService.AddUser(userDto);
await _chatGWContext.Clients.All.SendAsync("RefreshUserList");
await _chatGWContext.Clients.All.SendAsync("RefreshUserLists");
if(response.Success != false)
{
return Ok(response);

View File

@ -74,7 +74,7 @@ namespace qtc_api.Controllers
{
var updatedUser = await _userService.UpdateUserInfo(user);
await _chatGWContext.Clients.All.SendAsync("RefreshUserList");
await _chatGWContext.Clients.All.SendAsync("RefreshUserLists");
return Ok(updatedUser);
} else
@ -177,7 +177,8 @@ namespace qtc_api.Controllers
public async Task<ActionResult<ServiceResponse<User>>> DeleteUserById(string id)
{
var result = await _userService.DeleteUser(id);
await _chatGWContext.Clients.All.SendAsync("RefreshUserList");
await _chatGWContext.Clients.All.SendAsync("RefreshUserLists");
if (result != null && result.Success && result.Data != null) await _chatGWContext.Clients.User(result.Data.Id).SendAsync("ForceSignOut");
return Ok(result);
}