"use server" import { revalidatePath } from "next/cache" import { getCurrentMember } from "@/lib/member-auth" import { followPick, unfollowPick } from "@/lib/follows" export async function toggleFollowAction(lotteryId: string, country: string, targetDrawDate: string, isFollowing: boolean) { const member = await getCurrentMember() if (!member) return { ok: false as const, needsAuth: true as const } if (isFollowing) { await unfollowPick(member.id, lotteryId, targetDrawDate) } else { await followPick(member.id, lotteryId, country, targetDrawDate) } revalidatePath("/") revalidatePath("/profil") return { ok: true as const, needsAuth: false as const } }