"use server"; import { enrollUserInCourse } from "../../../helper/moodle"; import { prisma } from "@repo/db"; export const inscribeToMoodleCourse = async ( moodleCourseId: string | number, userMoodleId: string | number, ) => { await enrollUserInCourse(moodleCourseId, userMoodleId); }; export const addParticipant = async (eventId: number, userId: string) => { const participant = await prisma.participant.findFirst({ where: { userId: userId, }, }); if (!participant) { await prisma.participant.create({ data: { userId: userId, eventId, }, }); } };