wip
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Security.Claims;
|
||||
using Socialize.Infrastructure.Security;
|
||||
using Socialize.Api.Data;
|
||||
using Socialize.Api.Modules.Identity.Data;
|
||||
using Socialize.Api.Infrastructure.Security;
|
||||
|
||||
namespace Socialize.Modules.Workspaces.Handlers;
|
||||
namespace Socialize.Api.Modules.Workspaces.Handlers;
|
||||
|
||||
public record WorkspaceMemberDto(
|
||||
Guid Id,
|
||||
@@ -33,7 +37,7 @@ public class GetWorkspaceMembersHandler(
|
||||
|
||||
string workspaceClaimValue = workspaceId.ToString();
|
||||
|
||||
List<User> users = await dbContext.Users
|
||||
var users = await dbContext.Users
|
||||
.Where(candidate =>
|
||||
dbContext.UserClaims.Any(claim =>
|
||||
claim.UserId == candidate.Id &&
|
||||
@@ -44,7 +48,7 @@ public class GetWorkspaceMembersHandler(
|
||||
.ThenBy(candidate => candidate.Email)
|
||||
.ToListAsync(ct);
|
||||
|
||||
List<Guid> userIds = users
|
||||
var userIds = users
|
||||
.Select(candidate => candidate.Id)
|
||||
.ToList();
|
||||
|
||||
@@ -66,7 +70,7 @@ public class GetWorkspaceMembersHandler(
|
||||
.ToArray(),
|
||||
ct);
|
||||
|
||||
List<WorkspaceMemberDto> members = users
|
||||
var members = users
|
||||
.Select(candidate => new WorkspaceMemberDto(
|
||||
candidate.Id,
|
||||
BuildDisplayName(candidate),
|
||||
|
||||
Reference in New Issue
Block a user