1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-12 00:28:11 -05:00

AC-2330 add response to put method for updating cipher collections (#3964)

Co-authored-by: gbubemismith <gsmithwalter@gmail.com>
This commit is contained in:
Jason Ng 2024-04-09 10:39:26 -04:00 committed by GitHub
parent 40221f578f
commit c15574721d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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<CipherResponseModel> 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")]