1
0
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:
Jake Fink 2024-09-12 13:47:04 -04:00 committed by GitHub
parent 97795de19e
commit aa361341bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,4 +87,16 @@ public class FoldersController : Controller
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);
}
}
}