Skip to content

Commit

Permalink
[PM-10914] add endpoint to delete all folders (#4761)
Browse files Browse the repository at this point in the history
* add endpoint to delete all folders

* await folder deletions
  • Loading branch information
jlf0dev committed Sep 12, 2024
1 parent 97795de commit aa36134
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Api/Vault/Controllers/FoldersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,16 @@ public async Task Delete(string id)

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);
}
}
}

0 comments on commit aa36134

Please sign in to comment.