File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -31,12 +31,13 @@ export class TodoistApiClient {
3131 }
3232 }
3333
34- public async createTask ( content : string , options ?: CreateTaskParams ) : Promise < void > {
34+ public async createTask ( content : string , options ?: CreateTaskParams ) : Promise < Task > {
3535 const body = snakify ( {
3636 content : content ,
3737 ...( options ?? { } ) ,
3838 } ) ;
39- await this . do ( "/tasks" , "POST" , body ) ;
39+ const response = await this . do ( "/tasks" , "POST" , body ) ;
40+ return camelize ( JSON . parse ( response . body ) ) as Task ;
4041 }
4142
4243 public async closeTask ( id : TaskId ) : Promise < void > {
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ class LabelsRepository extends Repository<LabelId, Label> {
3939export class TodoistAdapter {
4040 public actions = {
4141 closeTask : async ( id : TaskId ) => await this . closeTask ( id ) ,
42- createTask : async ( content : string , params : CreateTaskParams ) =>
42+ createTask : async ( content : string , params : CreateTaskParams ) : Promise < ApiTask > =>
4343 await this . api . withInner ( ( api ) => api . createTask ( content , params ) ) ,
4444 } ;
4545
You can’t perform that action at this time.
0 commit comments