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:
parent
40221f578f
commit
c15574721d
@ -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")]
|
||||
|
Loading…
x
Reference in New Issue
Block a user