This repository was archived by the owner on Dec 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed
Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ export default class TDSClient {
4040 * If no params, creates a NO_CONTENT task
4141 * Returns true if all ok, then false.
4242 */
43- create ( { type = "task" } = { } , ObjectFromType ) {
43+ async create ( { type = "task" } = { } , ObjectFromType ) {
4444 const TypeManager = new IManager ( type , this . headers ) ;
45- return TypeManager . create ( ObjectFromType ) ;
45+ return await TypeManager . create ( ObjectFromType ) ;
4646 }
4747
4848 /**
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ export default class ProjectsManager {
66 this . headers = headers ;
77 }
88
9- create ( project = new Project ( ) ) {
10- axios . post (
9+ async create ( project = new Project ( ) ) {
10+ return await axios . post (
1111 `https://api.todoist.com/rest/v1/projects` ,
1212 project ,
1313 this . headers
@@ -40,7 +40,6 @@ export default class ProjectsManager {
4040 let project = await getOneJSON ( id , this . headers ) ;
4141 return project ;
4242 }
43-
4443}
4544
4645async function getAllJSON ( headers ) {
Original file line number Diff line number Diff line change @@ -6,8 +6,12 @@ export default class TasksManager {
66 this . headers = headers ;
77 }
88
9- create ( task = new Task ( ) ) {
10- axios . post ( `https://api.todoist.com/rest/v1/tasks` , task , this . headers ) ;
9+ async create ( task = new Task ( ) ) {
10+ return await axios . post (
11+ `https://api.todoist.com/rest/v1/tasks` ,
12+ task ,
13+ this . headers
14+ ) ;
1115 }
1216
1317 /**
You can’t perform that action at this time.
0 commit comments