etesync-web
etesync-web copied to clipboard
Feature request: clear completed tasks
I would like to add a way delete all completed tasks.
Does the library currently provide any way to perform a batch delete?
Yeah, it does, though not as part of the PIM abstraction, you will have to implement it yourself.
Take a look at etesync-helpers.ts you have there the current wrapper we use (addJournalEntry), you should create another one (or modify this one?) to accept an array instead of just one and then create multiple entries and call addEntries with the array.
Things to keep in mind:
-
prevUidis the uid of the previous item. So when you create multiple items, you need to update it every time, and every time set it to the uid of the entry you are just going to send. - You probably don't want to upload 400 changes at once, so you should loop over it in chunks of e.g. 30 and push them each. You can take a look at
helpers.tsxin the ios repo for a helper function to split an array to a chunks iterator. You can also look atsync/SyncManagerBase.tsthere for how we push in chunks.
Let me know if you need anything.