Commit 17b3f6d1 authored by pom421's avatar pom421
Browse files

fix: count with parseInt to have real numbers

parent d633efd7
......@@ -25,12 +25,12 @@ export default async (req, res) => {
const result = { currentDate: date.now }
result.acts = stats.reduce((acc, curr) => {
acc[curr.id] = { name: curr.name, total: curr.count }
acc[curr.id] = { name: curr.name, total: parseInt(curr.count, 10), last7days: 0 }
return acc
}, {})
stats7days.forEach(elt => {
result.acts[elt.id].last7days = elt.count
result.acts[elt.id].last7days = parseInt(elt.count, 10)
})
return res.status(STATUS_200_OK).json(result)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment