mirror of
https://github.com/bitwarden/server.git
synced 2025-07-07 02:52:50 -05:00
[PM-10563] Notification Center API (#4852)
* PM-10563: Notification Center API * PM-10563: continuation token hack * PM-10563: Resolving merge conflicts * PM-10563: Unit Tests * PM-10563: Paging simplification by page number and size in database * PM-10563: Request validation * PM-10563: Read, Deleted status filters change * PM-10563: Plural name for tests * PM-10563: Request validation to always for int type * PM-10563: Continuation Token returns null on response when no more records available * PM-10563: Integration tests for GET * PM-10563: Mark notification read, deleted commands date typos fix * PM-10563: Integration tests for PATCH read, deleted * PM-10563: Request, Response models tests * PM-10563: EditorConfig compliance * PM-10563: Extracting to const * PM-10563: Update db migration script date * PM-10563: Update migration script date
This commit is contained in:
@ -2,7 +2,9 @@ CREATE PROCEDURE [dbo].[Notification_ReadByUserIdAndStatus]
|
||||
@UserId UNIQUEIDENTIFIER,
|
||||
@ClientType TINYINT,
|
||||
@Read BIT,
|
||||
@Deleted BIT
|
||||
@Deleted BIT,
|
||||
@PageNumber INT = 1,
|
||||
@PageSize INT = 10
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
@ -21,13 +23,14 @@ BEGIN
|
||||
AND ou.[OrganizationId] IS NOT NULL))
|
||||
AND ((@Read IS NULL AND @Deleted IS NULL)
|
||||
OR (n.[NotificationStatusUserId] IS NOT NULL
|
||||
AND ((@Read IS NULL
|
||||
AND (@Read IS NULL
|
||||
OR IIF((@Read = 1 AND n.[ReadDate] IS NOT NULL) OR
|
||||
(@Read = 0 AND n.[ReadDate] IS NULL),
|
||||
1, 0) = 1)
|
||||
OR (@Deleted IS NULL
|
||||
OR IIF((@Deleted = 1 AND n.[DeletedDate] IS NOT NULL) OR
|
||||
(@Deleted = 0 AND n.[DeletedDate] IS NULL),
|
||||
1, 0) = 1))))
|
||||
AND (@Deleted IS NULL
|
||||
OR IIF((@Deleted = 1 AND n.[DeletedDate] IS NOT NULL) OR
|
||||
(@Deleted = 0 AND n.[DeletedDate] IS NULL),
|
||||
1, 0) = 1)))
|
||||
ORDER BY [Priority] DESC, n.[CreationDate] DESC
|
||||
OFFSET @PageSize * (@PageNumber - 1) ROWS FETCH NEXT @PageSize ROWS ONLY
|
||||
END
|
||||
|
Reference in New Issue
Block a user