From 2eef94afce4e2471b45298620fa34288d407f1db Mon Sep 17 00:00:00 2001 From: Raffael Sheikh Date: Sun, 7 Jun 2026 12:14:31 +0200 Subject: [PATCH] chore(format): Prettier auf time.ts anwenden MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alt-Bestand nie formatiert — isolierter Format-Lauf vor der byProject-Query. Co-Authored-By: Claude Opus 4.8 (1M context) --- apps/api/src/routers/time.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/apps/api/src/routers/time.ts b/apps/api/src/routers/time.ts index 4359fe1..e37a14a 100644 --- a/apps/api/src/routers/time.ts +++ b/apps/api/src/routers/time.ts @@ -44,7 +44,10 @@ function unionSeconds(intervals: Array): number { } async function stopOneEntry(db: Db, entry: TimeEntry, now: Date): Promise { - const durationSeconds = Math.max(0, Math.round((now.getTime() - entry.startedAt.getTime()) / 1000)); + const durationSeconds = Math.max( + 0, + Math.round((now.getTime() - entry.startedAt.getTime()) / 1000), + ); const [stopped] = await db .update(timeEntry) .set({ endedAt: now, durationSeconds, updatedAt: now }) @@ -199,7 +202,11 @@ export const timeRouter = router({ } const startedAt = input.startedAt ? new Date(input.startedAt) : existing.startedAt; const endedAt = - input.endedAt === undefined ? existing.endedAt : input.endedAt === null ? null : new Date(input.endedAt); + input.endedAt === undefined + ? existing.endedAt + : input.endedAt === null + ? null + : new Date(input.endedAt); const durationSeconds = endedAt ? Math.max(0, Math.round((endedAt.getTime() - startedAt.getTime()) / 1000)) : null; @@ -211,8 +218,7 @@ export const timeRouter = router({ durationSeconds, todoId: input.todoId === undefined ? existing.todoId : input.todoId, category: input.category ?? existing.category, - description: - input.description === undefined ? existing.description : input.description, + description: input.description === undefined ? existing.description : input.description, updatedAt: new Date(), }) .where(eq(timeEntry.id, input.id)) @@ -368,7 +374,9 @@ export const timeRouter = router({ .where(cond) .orderBy(asc(timeEntry.startedAt)); - const todoIds = Array.from(new Set(rows.map((r) => r.todoId).filter((x): x is string => !!x))); + const todoIds = Array.from( + new Set(rows.map((r) => r.todoId).filter((x): x is string => !!x)), + ); const titles = new Map(); if (todoIds.length > 0) { const tr = await ctx.db