added chron to hub server, removed starterEvent

This commit is contained in:
PxlLoewe
2025-02-28 07:21:07 +01:00
parent bbcde2eb4a
commit a477b65c2f
20 changed files with 584 additions and 281 deletions

View File

@@ -0,0 +1,26 @@
"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,
},
});
}
};