- {#each product.targets.slice(0, 3) as t}
+ {#each product.targets.slice(0, 3) as t (t)}
{t.replace(/_/g, ' ')}
{/each}
{#if product.targets.length > 3}
diff --git a/frontend/src/routes/routines/+page.server.ts b/frontend/src/routes/routines/+page.server.ts
index a8044d4..92710e7 100644
--- a/frontend/src/routes/routines/+page.server.ts
+++ b/frontend/src/routes/routines/+page.server.ts
@@ -2,10 +2,9 @@ import { getRoutines } from '$lib/api';
import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async ({ url }) => {
- const part_of_day = url.searchParams.get('part_of_day') ?? undefined;
const from_date = url.searchParams.get('from_date') ?? recentDate(30);
- const routines = await getRoutines({ from_date, part_of_day });
- return { routines, part_of_day };
+ const routines = await getRoutines({ from_date });
+ return { routines };
};
function recentDate(daysAgo: number): string {
diff --git a/frontend/src/routes/routines/+page.svelte b/frontend/src/routes/routines/+page.svelte
index ad71de5..4a8e5fa 100644
--- a/frontend/src/routes/routines/+page.svelte
+++ b/frontend/src/routes/routines/+page.svelte
@@ -2,14 +2,9 @@
import type { PageData } from './$types';
import { Badge } from '$lib/components/ui/badge';
import { Button } from '$lib/components/ui/button';
- import { goto } from '$app/navigation';
let { data }: { data: PageData } = $props();
- function filterPod(pod: string) {
- goto(pod ? `/routines?part_of_day=${pod}` : '/routines');
- }
-
// Group by date
const byDate = $derived(
data.routines.reduce(
@@ -34,25 +29,7 @@
-
-
-
-
-
-
- {#if sortedDates.length}
+{#if sortedDates.length}
{#each sortedDates as date}
diff --git a/frontend/src/routes/routines/[id]/+page.svelte b/frontend/src/routes/routines/[id]/+page.svelte
index f1d5235..155fecc 100644
--- a/frontend/src/routes/routines/[id]/+page.svelte
+++ b/frontend/src/routes/routines/[id]/+page.svelte
@@ -65,7 +65,7 @@
{/if}
- {#each products as p}
+ {#each products as p (p.id)}
{p.name} ({p.brand})
{/each}
@@ -90,7 +90,7 @@
{#if routine.steps.length}
- {#each routine.steps.toSorted((a, b) => a.order_index - b.order_index) as step}
+ {#each routine.steps.toSorted((a, b) => a.order_index - b.order_index) as step (step.id)}