feat: add total to timeMap
This commit is contained in:
1 parent
d74e8b3fcf
commit
95e09c6d21
1 file changed
+4
-1
@@ -31,7 +31,9 @@ function getCategories(categoriesField: any): string[] {
|
|||||||
type TimeMap = Record<string, number>
|
type TimeMap = Record<string, number>
|
||||||
|
|
||||||
export default async function EvaluationPage({ params }: PageProps) {
|
export default async function EvaluationPage({ params }: PageProps) {
|
||||||
let times: TimeMap = {};
|
let times: TimeMap = {
|
||||||
|
total: 0
|
||||||
|
};
|
||||||
|
|
||||||
// get all params
|
// get all params
|
||||||
const resolvedParams = await params;
|
const resolvedParams = await params;
|
||||||
@@ -77,6 +79,7 @@ export default async function EvaluationPage({ params }: PageProps) {
|
|||||||
const categories = getCategories(event.categories);
|
const categories = getCategories(event.categories);
|
||||||
|
|
||||||
categories.forEach((cat) => {
|
categories.forEach((cat) => {
|
||||||
|
times["total"] = (times["total"] || 0) + durationInMinutes
|
||||||
times[cat] = (times[cat] || 0) + durationInMinutes
|
times[cat] = (times[cat] || 0) + durationInMinutes
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in new issue
Block a user