12 lines
415 B
TypeScript
12 lines
415 B
TypeScript
"use server";
|
|
|
|
import { revalidatePath } from "next/cache";
|
|
import { setStrengthWorkoutNotes } from "@/lib/models/strength";
|
|
import { getCurrentUserId } from "@/lib/session";
|
|
|
|
export async function saveStrengthNotes(workoutId: string, notes: string): Promise<void> {
|
|
const userId = await getCurrentUserId();
|
|
await setStrengthWorkoutNotes(userId, workoutId, notes);
|
|
revalidatePath(`/strength/${workoutId}`);
|
|
}
|