init
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user