From f18c6a4e5cbfb6272457a1d6d1a92a33d1b0893b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Silva?= Date: Wed, 14 Dec 2022 23:10:07 +0000 Subject: [PATCH 1/2] Use Todoist's Sync API v9 v8 was deprecated on December 5, 2022. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 7b66c00..1253475 100644 --- a/index.js +++ b/index.js @@ -9,7 +9,7 @@ const PREMIUM = core.getInput("PREMIUM"); async function main() { const stats = await axios( - `https://api.todoist.com/sync/v8.3/completed/get_stats?token=${TODOIST_API_KEY}` + `https://api.todoist.com/sync/v9/completed/get_stats?token=${TODOIST_API_KEY}` ); await updateReadme(stats.data); } From c0695a3b88bba608d2a7c7d1568deb4221143c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Silva?= Date: Wed, 14 Dec 2022 23:21:47 +0000 Subject: [PATCH 2/2] Send auth token in header instead of query param Passing tokens as query params will be deprecated soon. --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 1253475..9d69af5 100644 --- a/index.js +++ b/index.js @@ -8,8 +8,9 @@ const TODOIST_API_KEY = core.getInput("TODOIST_API_KEY"); const PREMIUM = core.getInput("PREMIUM"); async function main() { - const stats = await axios( - `https://api.todoist.com/sync/v9/completed/get_stats?token=${TODOIST_API_KEY}` + const stats = await axios.get( + "https://api.todoist.com/sync/v9/completed/get_stats", + { headers: { Authorization: `Bearer ${TODOIST_API_KEY}` } } ); await updateReadme(stats.data); }