feat: add feedback comments activity notifications
This commit is contained in:
@@ -54,13 +54,20 @@ public class GetNotificationsHandler(
|
||||
}
|
||||
|
||||
IQueryable<NotificationEvent> query = dbContext.NotificationEvents.AsQueryable();
|
||||
Guid currentUserId = User.GetUserId();
|
||||
|
||||
if (!accessScopeService.IsManager(User))
|
||||
{
|
||||
IReadOnlyCollection<Guid> workspaceScopeIds = User.GetWorkspaceScopeIds();
|
||||
query = query.Where(notificationEvent => workspaceScopeIds.Contains(notificationEvent.WorkspaceId));
|
||||
query = query.Where(notificationEvent =>
|
||||
workspaceScopeIds.Contains(notificationEvent.WorkspaceId) ||
|
||||
notificationEvent.RecipientUserId == currentUserId);
|
||||
}
|
||||
|
||||
query = query.Where(notificationEvent =>
|
||||
notificationEvent.RecipientUserId == null ||
|
||||
notificationEvent.RecipientUserId == currentUserId);
|
||||
|
||||
if (request.WorkspaceId.HasValue)
|
||||
{
|
||||
query = query.Where(notificationEvent => notificationEvent.WorkspaceId == request.WorkspaceId.Value);
|
||||
|
||||
Reference in New Issue
Block a user