1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-18 09:35:20 +02:00
joplin/packages/lib/services/trash/emptyTrash.ts
2024-03-02 14:25:27 +00:00

13 lines
358 B
TypeScript

import BaseItem from '../../models/BaseItem';
import Folder from '../../models/Folder';
import Note from '../../models/Note';
export default async () => {
const result = await BaseItem.allItemsInTrash();
await Note.batchDelete(result.noteIds);
for (const folderId of result.folderIds) {
await Folder.delete(folderId, { deleteChildren: false });
}
};