chore: fix some warnings
This commit is contained in:
@@ -29,17 +29,17 @@ public class AppDbContext(
|
|||||||
public DbSet<ApprovalDecision> ApprovalDecisions => Set<ApprovalDecision>();
|
public DbSet<ApprovalDecision> ApprovalDecisions => Set<ApprovalDecision>();
|
||||||
public DbSet<NotificationEvent> NotificationEvents => Set<NotificationEvent>();
|
public DbSet<NotificationEvent> NotificationEvents => Set<NotificationEvent>();
|
||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
protected override void OnModelCreating(ModelBuilder builder)
|
||||||
{
|
{
|
||||||
base.OnModelCreating(modelBuilder);
|
base.OnModelCreating(builder);
|
||||||
|
|
||||||
modelBuilder.ConfigureWorkspacesModule();
|
builder.ConfigureWorkspacesModule();
|
||||||
modelBuilder.ConfigureClientsModule();
|
builder.ConfigureClientsModule();
|
||||||
modelBuilder.ConfigureProjectsModule();
|
builder.ConfigureProjectsModule();
|
||||||
modelBuilder.ConfigureContentItemsModule();
|
builder.ConfigureContentItemsModule();
|
||||||
modelBuilder.ConfigureAssetsModule();
|
builder.ConfigureAssetsModule();
|
||||||
modelBuilder.ConfigureCommentsModule();
|
builder.ConfigureCommentsModule();
|
||||||
modelBuilder.ConfigureApprovalsModule();
|
builder.ConfigureApprovalsModule();
|
||||||
modelBuilder.ConfigureNotificationsModule();
|
builder.ConfigureNotificationsModule();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public record WorkspaceDto(
|
|||||||
string TimeZone,
|
string TimeZone,
|
||||||
DateTimeOffset CreatedAt);
|
DateTimeOffset CreatedAt);
|
||||||
|
|
||||||
public class GetWorkspacesHandler(
|
internal class GetWorkspacesHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService)
|
AccessScopeService accessScopeService)
|
||||||
: EndpointWithoutRequest<IReadOnlyCollection<WorkspaceDto>>
|
: EndpointWithoutRequest<IReadOnlyCollection<WorkspaceDto>>
|
||||||
@@ -27,15 +27,15 @@ public class GetWorkspacesHandler(
|
|||||||
|
|
||||||
public override async Task HandleAsync(CancellationToken ct)
|
public override async Task HandleAsync(CancellationToken ct)
|
||||||
{
|
{
|
||||||
IQueryable<Workspace> query = dbContext.Workspaces.AsQueryable();
|
var query = dbContext.Workspaces.AsQueryable();
|
||||||
|
|
||||||
if (!accessScopeService.IsManager(User))
|
if (!accessScopeService.IsManager(User))
|
||||||
{
|
{
|
||||||
IReadOnlyCollection<Guid> workspaceScopeIds = User.GetWorkspaceScopeIds();
|
var workspaceScopeIds = User.GetWorkspaceScopeIds();
|
||||||
query = query.Where(workspace => workspaceScopeIds.Contains(workspace.Id));
|
query = query.Where(workspace => workspaceScopeIds.Contains(workspace.Id));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<WorkspaceDto> workspaces = await query
|
var workspaces = await query
|
||||||
.OrderBy(workspace => workspace.Name)
|
.OrderBy(workspace => workspace.Name)
|
||||||
.Select(workspace => new WorkspaceDto(
|
.Select(workspace => new WorkspaceDto(
|
||||||
workspace.Id,
|
workspace.Id,
|
||||||
|
|||||||
Reference in New Issue
Block a user