This commit is contained in:
Dominik Klarkowski
2026-06-18 11:02:31 +02:00
parent d00a5a42ac
commit 047e580da0
32 changed files with 735 additions and 189 deletions

View File

@@ -4,6 +4,7 @@ import { redirect } from "next/navigation";
import { revalidatePath } from "next/cache";
import { parseStrongShareText } from "@/lib/strong/parser";
import { upsertStrengthWorkout } from "@/lib/models/strength";
import { getCurrentUserId } from "@/lib/session";
export type ImportStrongWorkoutState = { error: string } | null;
@@ -27,8 +28,9 @@ export async function importStrongWorkout(
return { error: "Nie znaleziono żadnego treningu w podanym tekście." };
}
const userId = await getCurrentUserId();
for (const workout of workouts) {
await upsertStrengthWorkout(workout);
await upsertStrengthWorkout(userId, workout);
}
revalidatePath("/strength");