From 9423cd673caff2797c9b3dd7afc58a91f4f5d5ca Mon Sep 17 00:00:00 2001 From: Marcel Raddatz Date: Fri, 10 Apr 2026 14:16:50 +0200 Subject: [PATCH] refactor(planner): type tag mapping callback as TagItem in server load Replaces (t: any) with (t: TagItem) so the API response shape is validated against the shared TagItem interface. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/routes/(app)/planner/+page.server.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/routes/(app)/planner/+page.server.ts b/frontend/src/routes/(app)/planner/+page.server.ts index e318cf4..15f6c15 100644 --- a/frontend/src/routes/(app)/planner/+page.server.ts +++ b/frontend/src/routes/(app)/planner/+page.server.ts @@ -2,6 +2,7 @@ import type { PageServerLoad, Actions } from './$types'; import { apiClient } from '$lib/server/api'; import { getWeekStart } from '$lib/planner/week'; import { addSlotAction, updateSlotAction, deleteSlotAction } from '$lib/server/slotActions'; +import type { TagItem } from '$lib/planner/types'; export const load: PageServerLoad = async ({ fetch, url }) => { const weekParam = url.searchParams.get('week'); @@ -22,7 +23,7 @@ export const load: PageServerLoad = async ({ fetch, url }) => { cookTimeMin: r.cookTimeMin, effort: r.effort, heroImageUrl: r.heroImageUrl, - tags: (r.tags ?? []).map((t: any) => ({ id: t.id, name: t.name, tagType: t.tagType })) + tags: (r.tags ?? []).map((t: TagItem) => ({ id: t.id, name: t.name, tagType: t.tagType })) })); if (weekPlanResult.error || !weekPlanResult.data?.id) {