Api: Make getGitActivity return an array with datapoint objects

This commit is contained in:
networkException 2021-04-04 21:07:43 +02:00
parent 8d7235bb82
commit 38d7bd2c40

View file

@ -67,7 +67,7 @@ async function getData(): Promise<string> {
}
async function getGitData(): Promise<{ [date: string]: number }> {
async function getGitData(): Promise<Array<{ date: string, count: number}>> {
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] }; });
}