Skip to content

Commit 9131427

Browse files
authored
Added bump account revision date to sproc (#6640)
1 parent 931f0c6 commit 9131427

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

src/Sql/dbo/Vault/Stored Procedures/Cipher/CipherDetails_CreateWithCollections.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,10 @@ BEGIN
3030

3131
DECLARE @UpdateCollectionsSuccess INT
3232
EXEC @UpdateCollectionsSuccess = [dbo].[Cipher_UpdateCollections] @Id, @UserId, @OrganizationId, @CollectionIds
33+
34+
-- Bump the account revision date AFTER collections are assigned.
35+
IF @UpdateCollectionsSuccess = 0
36+
BEGIN
37+
EXEC [dbo].[User_BumpAccountRevisionDateByCipherId] @Id, @OrganizationId
38+
END
3339
END
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
CREATE OR ALTER PROCEDURE [dbo].[CipherDetails_CreateWithCollections]
2+
@Id UNIQUEIDENTIFIER,
3+
@UserId UNIQUEIDENTIFIER,
4+
@OrganizationId UNIQUEIDENTIFIER,
5+
@Type TINYINT,
6+
@Data NVARCHAR(MAX),
7+
@Favorites NVARCHAR(MAX), -- not used
8+
@Folders NVARCHAR(MAX), -- not used
9+
@Attachments NVARCHAR(MAX), -- not used
10+
@CreationDate DATETIME2(7),
11+
@RevisionDate DATETIME2(7),
12+
@FolderId UNIQUEIDENTIFIER,
13+
@Favorite BIT,
14+
@Edit BIT, -- not used
15+
@ViewPassword BIT, -- not used
16+
@Manage BIT, -- not used
17+
@OrganizationUseTotp BIT, -- not used
18+
@DeletedDate DATETIME2(7),
19+
@Reprompt TINYINT,
20+
@Key VARCHAR(MAX) = NULL,
21+
@CollectionIds AS [dbo].[GuidIdArray] READONLY,
22+
@ArchivedDate DATETIME2(7) = NULL
23+
AS
24+
BEGIN
25+
SET NOCOUNT ON
26+
27+
EXEC [dbo].[CipherDetails_Create] @Id, @UserId, @OrganizationId, @Type, @Data, @Favorites, @Folders,
28+
@Attachments, @CreationDate, @RevisionDate, @FolderId, @Favorite, @Edit, @ViewPassword, @Manage,
29+
@OrganizationUseTotp, @DeletedDate, @Reprompt, @Key, @ArchivedDate
30+
31+
DECLARE @UpdateCollectionsSuccess INT
32+
EXEC @UpdateCollectionsSuccess = [dbo].[Cipher_UpdateCollections] @Id, @UserId, @OrganizationId, @CollectionIds
33+
34+
-- Bump the account revision date AFTER collections are assigned.
35+
IF @UpdateCollectionsSuccess = 0
36+
BEGIN
37+
EXEC [dbo].[User_BumpAccountRevisionDateByCipherId] @Id, @OrganizationId
38+
END
39+
END

0 commit comments

Comments
 (0)