File tree Expand file tree Collapse file tree 1 file changed +26
-3
lines changed
components/todoist/sources/completed-task Expand file tree Collapse file tree 1 file changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,36 @@ export default {
55 key : "todoist-completed-task" ,
66 name : "New Completed Task" ,
77 description : "Emit new event for each completed task. [See the docs here](https://developer.todoist.com/sync/v8/#read-resources)" ,
8- version : "0 .0.6 " ,
8+ version : "1 .0.0 " ,
99 type : "source" ,
1010 dedupe : "unique" ,
1111 methods : {
1212 ...common . methods ,
13- isElementRelevant ( element ) {
14- return element . checked ;
13+ _getLastDate ( ) {
14+ return this . db . get ( "lastDate" ) ;
15+ } ,
16+ _setLastDate ( value ) {
17+ this . db . set ( "lastDate" , value ) ;
18+ } ,
19+ async getSyncResult ( ) {
20+ const lastDate = this . _getLastDate ( ) ;
21+ const items = await this . todoist . getCompletedTasks ( {
22+ params : {
23+ since : lastDate ,
24+ annotate_items : true ,
25+ } ,
26+ } ) ;
27+
28+ const newDate = new Date ( ) . toISOString ( ) ;
29+ this . _setLastDate ( newDate ) ;
30+
31+ console . log ( items ) ;
32+ return items ;
33+ } ,
34+ filterResults ( syncResult ) {
35+ return syncResult
36+ . filter ( ( element ) =>
37+ this . todoist . isProjectInList ( element . project_id , this . selectProjects ?? [ ] ) ) ;
1538 } ,
1639 } ,
1740} ;
You can’t perform that action at this time.
0 commit comments