1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-05 18:12:48 -05:00

PM-11123: Notification Status Details view (#4848)

* PM-11123: Notification Status Details view

* PM-11123: Test Typo

* PM-11123: New line missing

* PM-11123: Delete unnecessary field

* PM-11123: Moved NotificationStatusDetails to Models/Data
This commit is contained in:
Maciej Zieniuk
2024-10-03 22:13:43 +02:00
committed by GitHub
parent 7e22a6d036
commit 738febf031
16 changed files with 295 additions and 137 deletions

View File

@ -2,6 +2,7 @@
using System.Data;
using Bit.Core.Enums;
using Bit.Core.NotificationCenter.Entities;
using Bit.Core.NotificationCenter.Models.Data;
using Bit.Core.NotificationCenter.Models.Filter;
using Bit.Core.NotificationCenter.Repositories;
using Bit.Core.Settings;
@ -23,12 +24,12 @@ public class NotificationRepository : Repository<Notification, Guid>, INotificat
{
}
public async Task<IEnumerable<Notification>> GetByUserIdAndStatusAsync(Guid userId,
public async Task<IEnumerable<NotificationStatusDetails>> GetByUserIdAndStatusAsync(Guid userId,
ClientType clientType, NotificationStatusFilter? statusFilter)
{
await using var connection = new SqlConnection(ConnectionString);
var results = await connection.QueryAsync<Notification>(
var results = await connection.QueryAsync<NotificationStatusDetails>(
"[dbo].[Notification_ReadByUserIdAndStatus]",
new { UserId = userId, ClientType = clientType, statusFilter?.Read, statusFilter?.Deleted },
commandType: CommandType.StoredProcedure);