init
This commit is contained in:
11
app/strength/actions.ts
Normal file
11
app/strength/actions.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
"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}`);
|
||||
}
|
||||
Reference in New Issue
Block a user