feat: update ProjectE application

This commit is contained in:
2026-07-18 19:05:52 -04:00
parent 8f55626e03
commit 4c1cc50231
68 changed files with 1586 additions and 697 deletions
+8 -1
View File
@@ -15,13 +15,19 @@ export const GET = withAuth(async (request: NextRequest, _user) => {
});
const byDomain: Record<string, number> = {};
const byDate: Record<string, number> = {};
const byProject: Record<string, number> = {};
const byTag: Record<string, number> = {};
let totalMinutes = 0;
for (const entry of entries) {
const duration = (entry.duration_minutes as number) || 0;
const duration = (entry.duration_minutes as number) || (entry.duration as number) || 0;
totalMinutes += duration;
const startedAt = entry.started_at as string | undefined;
if (startedAt) {
const date = new Date(startedAt).toISOString().slice(0, 10);
byDate[date] = (byDate[date] || 0) + duration;
}
// Get task for domain/project/tags
const task = await pb.collection('tasks').getOne(entry.task_id as string);
@@ -43,6 +49,7 @@ export const GET = withAuth(async (request: NextRequest, _user) => {
return NextResponse.json({
totalMinutes,
byDomain,
byDate,
byProject,
byTag,
startDate,