1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 00:22:50 -05:00

bulk action apis for delete and move

This commit is contained in:
Kyle Spearrin
2017-06-09 00:30:59 -04:00
parent 90402b0802
commit d3073e675e
6 changed files with 70 additions and 0 deletions

View File

@ -241,5 +241,21 @@ namespace Bit.Api.Controllers
await _cipherService.DeleteAsync(cipher, userId, true);
}
[HttpDelete("")]
[HttpPost("delete")]
public async Task DeleteMany([FromBody]CipherBulkDeleteRequestModel model)
{
var userId = _userService.GetProperUserId(User).Value;
await _cipherService.DeleteManyAsync(model.Ids.Select(i => new Guid(i)), userId);
}
[HttpPut("move")]
[HttpPost("move")]
public async Task MoveMany([FromBody]CipherBulkMoveRequestModel model)
{
var userId = _userService.GetProperUserId(User).Value;
await _cipherService.MoveManyAsync(model.Ids.Select(i => new Guid(i)), new Guid(model.FolderId), userId);
}
}
}