From c15574721d8067b56917bf8b0307e10faf6f9374 Mon Sep 17 00:00:00 2001 From: Jason Ng Date: Tue, 9 Apr 2024 10:39:26 -0400 Subject: [PATCH] AC-2330 add response to put method for updating cipher collections (#3964) Co-authored-by: gbubemismith --- src/Api/Vault/Controllers/CiphersController.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Api/Vault/Controllers/CiphersController.cs b/src/Api/Vault/Controllers/CiphersController.cs index 80a453dfc4..cd70d7a6c0 100644 --- a/src/Api/Vault/Controllers/CiphersController.cs +++ b/src/Api/Vault/Controllers/CiphersController.cs @@ -560,7 +560,7 @@ public class CiphersController : Controller [HttpPut("{id}/collections")] [HttpPost("{id}/collections")] - public async Task PutCollections(Guid id, [FromBody] CipherCollectionsRequestModel model) + public async Task PutCollections(Guid id, [FromBody] CipherCollectionsRequestModel model) { var userId = _userService.GetProperUserId(User).Value; var cipher = await GetByIdAsync(id, userId); @@ -572,6 +572,10 @@ public class CiphersController : Controller await _cipherService.SaveCollectionsAsync(cipher, model.CollectionIds.Select(c => new Guid(c)), userId, false); + + var updatedCipherCollections = await GetByIdAsync(id, userId); + var response = new CipherResponseModel(updatedCipherCollections, _globalSettings); + return response; } [HttpPut("{id}/collections-admin")]