feat: Add button to empty trash (#6772)

Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
Hemachandar
2024-04-16 18:34:56 +05:30
committed by GitHub
parent a5d2752122
commit ef0fb74308
11 changed files with 244 additions and 18 deletions

View File

@@ -765,6 +765,14 @@ export default class DocumentsStore extends Store<Document> {
});
};
@action
emptyTrash = async () => {
await client.post("/documents.empty_trash");
const documentIdsSet = new Set(this.deleted.map((doc) => doc.id));
this.removeAll((doc: Document) => documentIdsSet.has(doc.id));
};
star = (document: Document, index?: string) =>
this.rootStore.stars.create({
documentId: document.id,