diff --git a/src/Argon.Api/Services/UserInteractionService.cs b/src/Argon.Api/Services/UserInteractionService.cs index cbb229f8..85798eb6 100644 --- a/src/Argon.Api/Services/UserInteractionService.cs +++ b/src/Argon.Api/Services/UserInteractionService.cs @@ -8,26 +8,34 @@ public class UserInteractionService( IGrainFactory grainFactory ) : IUserInteraction { - public async Task GetMe() => await grainFactory.GetGrain(username).Get(); + private readonly IUserManager userManager = grainFactory.GetGrain(username); - public async Task CreateServer(CreateServerRequest request) => - await grainFactory - .GetGrain(username) - .CreateServer(request.Name, request.Description); + public async Task GetMe() + { + return await userManager.Get(); + } - public async Task> GetServers() => - (await grainFactory - .GetGrain(username) - .GetServers()) - .Select(x => (ServerResponse)x) - .ToList(); + public async Task CreateServer(CreateServerRequest request) + { + return await userManager.CreateServer(request.Name, request.Description); + } - public async Task> GetServerDetails(ServerDetailsRequest request) => - (await grainFactory.GetGrain(username).GetServerChannels(request.ServerId)) - .Select(x => (ServerDetailsResponse)x) - .ToList(); + public async Task> GetServers() + { + return (await userManager.GetServers()) + .Select(x => (ServerResponse)x) + .ToList(); + } - public async Task JoinChannel(ChannelJoinRequest request) => - new((await grainFactory.GetGrain(username) - .JoinChannel(request.ServerId, request.ChannelId)).value); + public async Task> GetServerDetails(ServerDetailsRequest request) + { + return (await userManager.GetServerChannels(request.ServerId)) + .Select(x => (ServerDetailsResponse)x) + .ToList(); + } + + public async Task JoinChannel(ChannelJoinRequest request) + { + return new ChannelJoinResponse((await userManager.JoinChannel(request.ServerId, request.ChannelId)).value); + } } \ No newline at end of file