1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 15:23:33 +00:00

[PM-10914] add option to delete all folders if migration fails (#10983)

* add option to delete all folders if migration fails

* update text and flow to reattempt migration

* clear encrypted folders as well on delete all

* Update messaging
This commit is contained in:
Jake Fink
2024-09-12 13:47:35 -04:00
committed by GitHub
parent 3be5c4800b
commit 07d2e36496
4 changed files with 33 additions and 3 deletions

View File

@@ -5,4 +5,5 @@ export class FolderApiServiceAbstraction {
save: (folder: Folder) => Promise<any>;
delete: (id: string) => Promise<any>;
get: (id: string) => Promise<FolderResponse>;
deleteAll: () => Promise<void>;
}

View File

@@ -32,6 +32,11 @@ export class FolderApiService implements FolderApiServiceAbstraction {
await this.folderService.delete(id);
}
async deleteAll(): Promise<void> {
await this.apiService.send("DELETE", "/folders/all", null, true, false);
await this.folderService.clear();
}
async get(id: string): Promise<FolderResponse> {
const r = await this.apiService.send("GET", "/folders/" + id, null, true, true);
return new FolderResponse(r);