mirror of
https://github.com/bitwarden/server.git
synced 2024-11-21 12:05:42 +01:00
[PM-10914] add endpoint to delete all folders (#4761)
* add endpoint to delete all folders * await folder deletions
This commit is contained in:
parent
97795de19e
commit
aa361341bd
@ -87,4 +87,16 @@ public class FoldersController : Controller
|
|||||||
|
|
||||||
await _cipherService.DeleteFolderAsync(folder);
|
await _cipherService.DeleteFolderAsync(folder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpDelete("all")]
|
||||||
|
public async Task DeleteAll()
|
||||||
|
{
|
||||||
|
var userId = _userService.GetProperUserId(User).Value;
|
||||||
|
var allFolders = await _folderRepository.GetManyByUserIdAsync(userId);
|
||||||
|
|
||||||
|
foreach (var folder in allFolders)
|
||||||
|
{
|
||||||
|
await _cipherService.DeleteFolderAsync(folder);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user