35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
import { Event, EventAppointment, Participant, Prisma } from "@repo/db";
|
|
import axios from "axios";
|
|
|
|
export const getEvents = async (filter: Prisma.EventWhereInput) => {
|
|
const { data } = await axios.get<
|
|
(Event & {
|
|
Appointments: (EventAppointment & {
|
|
Appointments: EventAppointment[];
|
|
Participants: Participant[];
|
|
})[];
|
|
Participants: Participant[];
|
|
})[]
|
|
>(`/api/event`, {
|
|
params: {
|
|
filter: JSON.stringify(filter),
|
|
},
|
|
});
|
|
return data;
|
|
};
|
|
|
|
export const handleParticipantFinished = async (participantId: string) =>
|
|
axios.post(`${process.env.NEXT_PUBLIC_HUB_SERVER_URL}/event/handle-participant-finished`, {
|
|
participantId,
|
|
});
|
|
|
|
export const checkMoodleResults = async (participantId: string) =>
|
|
axios.post(`${process.env.NEXT_PUBLIC_HUB_SERVER_URL}/event/check-moodle-results`, {
|
|
participantId,
|
|
});
|
|
|
|
export const handleParticipantEnrolled = async (participantId: string) =>
|
|
axios.post(`${process.env.NEXT_PUBLIC_HUB_SERVER_URL}/event/handle-participant-enrolled`, {
|
|
participantId,
|
|
});
|