From 38d7bd2c407b599231a6192a1c817251692e90ca Mon Sep 17 00:00:00 2001 From: networkException Date: Sun, 4 Apr 2021 21:07:43 +0200 Subject: [PATCH] Api: Make getGitActivity return an array with datapoint objects --- src/pages/api/getGitActivity.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/api/getGitActivity.ts b/src/pages/api/getGitActivity.ts index a3e7060..28ebaf2 100644 --- a/src/pages/api/getGitActivity.ts +++ b/src/pages/api/getGitActivity.ts @@ -67,7 +67,7 @@ async function getData(): Promise { } -async function getGitData(): Promise<{ [date: string]: number }> { +async function getGitData(): Promise> { console.log("Refreshing Data"); let token = "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"; @@ -122,5 +122,5 @@ async function getGitData(): Promise<{ [date: string]: number }> { } } - return output; + return Object.keys(output).map(date => { return { date, count: output[date] }; }); } \ No newline at end of file