Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/IsaacApiTypesAutoGenerated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@ export interface CompetitionEntryDTO {
submissionURL?: string;
groupName?: string;
projectTitle?: string;
yearGroup?: string;
projectDescription?: string;
}

export interface DetailedEventBookingDTO extends EventBookingDTO {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,15 @@ export const CompetitionEntryForm = ({ handleTermsClick }: CompetitionEntryFormP
.map((memberId) => Number.parseInt(memberId, 10))
.filter((id) => !Number.isNaN(id));

reserveUsersOnCompetition(COMPETITON_ID, reservableIds, projectLink, projectTitle, groupName);
reserveUsersOnCompetition(
COMPETITON_ID,
reservableIds,
projectLink,
projectTitle,
groupName,
selectedYearGroup ?? undefined,
projectDescription,
);
}

setProjectTitle("");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export const useReserveUsersOnCompetition = () => {
submissionLink: string,
projectTitle: string,
groupName?: string,
yearGroup?: string,
projectDescription?: string,
) => {
try {
await api.eventBookings.reserveUsersOnCompetition(
Expand All @@ -19,6 +21,8 @@ export const useReserveUsersOnCompetition = () => {
submissionLink,
groupName ?? "",
projectTitle,
yearGroup ?? "",
projectDescription ?? "",
);
dispatch(
showSuccessToast("Competition entry submitted", "You have successfully submitted your competition entry"),
Expand Down
4 changes: 4 additions & 0 deletions src/app/services/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,12 +480,16 @@ export const api = {
submissionLink: string,
groupName: string,
projectTitle: string,
yearGroup: string,
projectDescription: string,
) => {
return endpoint.post(`/events/${eventId}/competitionEntries`, {
entrantIds: userIds,
submissionURL: submissionLink,
groupName: groupName,
projectTitle: projectTitle,
yearGroup: yearGroup,
projectDescription: projectDescription,
});
},
cancelUsersReservationsOnEvent: (eventId: string, userIds: number[]) => {
Expand Down
Loading