From 4311eadf50351e2ee930ec8dde6d48cc4d9d14a4 Mon Sep 17 00:00:00 2001 From: Raffael Sheikh Date: Sun, 7 Jun 2026 12:37:59 +0200 Subject: [PATCH] chore(format): Prettier auf day-entry.ts + TopNav.tsx 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 myWeek-Query und dem Woche-Nav-Tab. Co-Authored-By: Claude Opus 4.8 (1M context) --- apps/api/src/routers/day-entry.ts | 28 ++++++++++++----------- apps/web/src/components/layout/TopNav.tsx | 5 +++- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/apps/api/src/routers/day-entry.ts b/apps/api/src/routers/day-entry.ts index e3596a2..48a49a8 100644 --- a/apps/api/src/routers/day-entry.ts +++ b/apps/api/src/routers/day-entry.ts @@ -104,11 +104,7 @@ export async function applyWorkdayBoundary(db: Db, userId: string, now: Date): P * 06:00 des Folgetags — also noch fortsetzbar). `null`, wenn kein laufender/heutiger * Tag existiert (→ Frontend zeigt das Einstempel-Formular). */ -export async function getActiveEntry( - db: Db, - userId: string, - now: Date, -): Promise { +export async function getActiveEntry(db: Db, userId: string, now: Date): Promise { await applyWorkdayBoundary(db, userId, now); const entry = ( await db @@ -130,11 +126,9 @@ export const dayEntryRouter = router({ */ todayTeam: protectedProcedure.query(async ({ ctx }) => { const date = todayIso(); - const entries = await ctx.db - .select() - .from(dayEntry) - .where(eq(dayEntry.date, date)); - if (entries.length === 0) return [] as Array<{ userId: string; entryStatus: string; todos: Todo[] }>; + const entries = await ctx.db.select().from(dayEntry).where(eq(dayEntry.date, date)); + if (entries.length === 0) + return [] as Array<{ userId: string; entryStatus: string; todos: Todo[] }>; const ids = entries.map((e) => e.id); const todos = await ctx.db .select() @@ -339,7 +333,8 @@ export const dayEntryRouter = router({ if (!entry) { throw new TRPCError({ code: 'BAD_REQUEST', - message: 'Kein fortsetzbarer Arbeitstag — der letzte Tag ist abgeschlossen. Stempel neu ein.', + message: + 'Kein fortsetzbarer Arbeitstag — der letzte Tag ist abgeschlossen. Stempel neu ein.', }); } if (!entry.checkedOutAt) return entry; // läuft bereits @@ -484,7 +479,10 @@ export const dayEntryRouter = router({ .mutation(async ({ ctx, input }) => { const entry = await getActiveEntry(ctx.db, ctx.user.id, new Date()); if (!entry) { - throw new TRPCError({ code: 'BAD_REQUEST', message: 'Du bist gerade nicht eingestempelt.' }); + throw new TRPCError({ + code: 'BAD_REQUEST', + message: 'Du bist gerade nicht eingestempelt.', + }); } const existing = await ctx.db .select({ id: todo.id }) @@ -632,7 +630,11 @@ export const dayEntryRouter = router({ const ids = entries.map((e) => e.id); const todoRows = ids.length - ? await ctx.db.select().from(todo).where(inArray(todo.dayEntryId, ids)).orderBy(asc(todo.order)) + ? await ctx.db + .select() + .from(todo) + .where(inArray(todo.dayEntryId, ids)) + .orderBy(asc(todo.order)) : []; const todosByEntry = new Map(); for (const t of todoRows) { diff --git a/apps/web/src/components/layout/TopNav.tsx b/apps/web/src/components/layout/TopNav.tsx index 2b96fdf..e4c646e 100644 --- a/apps/web/src/components/layout/TopNav.tsx +++ b/apps/web/src/components/layout/TopNav.tsx @@ -37,7 +37,10 @@ export function TopNav() { className="mx-auto flex h-14 max-w-[1280px] items-center gap-2 px-6" aria-label="Hauptnavigation" > - + {voice.appName}