Fix error if plausible api is locked

pull/2741/head
Jérémy Rialland 2023-06-20 11:08:36 +02:00 committed by Jérémy Rialland
parent d734a27cd5
commit 32a5168a43
1 changed files with 4 additions and 1 deletions

View File

@ -43,7 +43,10 @@ export const apiStats = async (start, end, interval) => {
)
.filter((x) => !!x)
.flatMap(({ results }, i) =>
results.map(({ date, pageviews }) => ({ date, [names[i]]: pageviews }))
(results || []).map(({ date, pageviews }) => ({
date,
[names[i]]: pageviews,
}))
)
.reduce(
(acc, el) => (