File tree Expand file tree Collapse file tree 3 files changed +9
-10
lines changed
BotSharp.Abstraction/Repositories/Filters
BotSharp.OpenAPI/Controllers/User
Plugins/BotSharp.Plugin.ChatHub Expand file tree Collapse file tree 3 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -4,10 +4,7 @@ namespace BotSharp.Abstraction.Repositories.Filters;
44
55public class RoleFilter
66{
7- [ JsonPropertyName ( "names" ) ]
87 public IEnumerable < string > ? Names { get ; set ; }
9-
10- [ JsonPropertyName ( "exclude_roles" ) ]
118 public IEnumerable < string > ? ExcludeRoles { get ; set ; } = UserConstant . AdminRoles ;
129
1310
Original file line number Diff line number Diff line change @@ -36,8 +36,8 @@ public async Task<IEnumerable<string>> GetRoleOptions()
3636 }
3737
3838 [ BotSharpAuth ]
39- [ HttpPost ( "/roles" ) ]
40- public async Task < IEnumerable < RoleViewModel > > GetRoles ( [ FromBody ] RoleFilter ? filter = null )
39+ [ HttpGet ( "/roles" ) ]
40+ public async Task < IEnumerable < RoleViewModel > > GetRoles ( [ FromQuery ] RoleFilter ? filter = null )
4141 {
4242 if ( filter == null )
4343 {
Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ public class SignalRHub : Hub
1212 private readonly IUserIdentity _user ;
1313 private readonly IHttpContextAccessor _context ;
1414
15- public SignalRHub ( IServiceProvider services ,
15+ public SignalRHub (
16+ IServiceProvider services ,
1617 ILogger < SignalRHub > logger ,
1718 IUserIdentity user ,
1819 IHttpContextAccessor context )
@@ -25,15 +26,16 @@ public SignalRHub(IServiceProvider services,
2526
2627 public override async Task OnConnectedAsync ( )
2728 {
28- _logger . LogInformation ( $ "SignalR Hub: { _user . FirstName } { _user . LastName } ({ Context . User . Identity . Name } ) connected in { Context . ConnectionId } ") ;
29-
3029 var convService = _services . GetRequiredService < IConversationService > ( ) ;
31- var httpContext = Context . GetHttpContext ( ) ;
30+ var httpContext = Context ? . GetHttpContext ( ) ;
31+
32+ _logger . LogInformation ( $ "SignalR Hub: { _user ? . FirstName } { _user ? . LastName } ({ Context ? . User ? . Identity ? . Name ?? "Unkown user" } ) connected in { Context ? . ConnectionId } ") ;
33+
3234 string ? conversationId = httpContext ? . Request ? . Query [ "conversation-id" ] . FirstOrDefault ( ) ;
3335
3436 if ( ! string . IsNullOrEmpty ( conversationId ) )
3537 {
36- _logger . LogInformation ( $ "Connection { Context . ConnectionId } is with conversation { conversationId } ") ;
38+ _logger . LogInformation ( $ "Connection { Context ? . ConnectionId } is with conversation { conversationId } ") ;
3739 await AddGroup ( conversationId ) ;
3840
3941 var conv = await convService . GetConversation ( conversationId ) ;
You can’t perform that action at this time.
0 commit comments