Skip to content

Commit bf7fd28

Browse files
kevin-lanngithub-actions[bot]
authored andcommitted
Auto-formatted the code using Prettier
1 parent 4206b26 commit bf7fd28

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

course-matrix/backend/src/constants/availableFunctions.ts

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
import { generateWeeklyCourseEvents } from "../controllers/eventsController";
22
import { supabase } from "../db/setupDb";
33
import { Request } from "express";
4-
import { GroupedOfferingList, Offering, OfferingList } from "../types/generatorTypes";
5-
import { categorizeValidOfferings, getMaxDays, getValidOfferings, groupOfferings, trim } from "../utils/generatorHelpers";
4+
import {
5+
GroupedOfferingList,
6+
Offering,
7+
OfferingList,
8+
} from "../types/generatorTypes";
9+
import {
10+
categorizeValidOfferings,
11+
getMaxDays,
12+
getValidOfferings,
13+
groupOfferings,
14+
trim,
15+
} from "../utils/generatorHelpers";
616
import getOfferings from "../services/getOfferings";
717
import { getValidSchedules } from "../services/getValidSchedules";
818

@@ -252,7 +262,10 @@ export const availableFunctions: AvailableFunctions = {
252262
.maybeSingle();
253263

254264
if (existingTimetableError) {
255-
return { status: 400, error: `Existing timetable with name: ${name}. Please rename timetable.`};
265+
return {
266+
status: 400,
267+
error: `Existing timetable with name: ${name}. Please rename timetable.`,
268+
};
256269
}
257270

258271
if (existingTimetable) {
@@ -283,9 +296,12 @@ export const availableFunctions: AvailableFunctions = {
283296
await insertTimetable;
284297

285298
if (timetableError) {
286-
return { status: 400, error: "Timetable error" + timetableError.message };
299+
return {
300+
status: 400,
301+
error: "Timetable error" + timetableError.message,
302+
};
287303
}
288-
console.log("1")
304+
console.log("1");
289305
// Insert events
290306
for (const offering of schedule) {
291307
//Query course offering information
@@ -296,7 +312,11 @@ export const availableFunctions: AvailableFunctions = {
296312
.eq("id", offering.id)
297313
.maybeSingle();
298314

299-
if (offeringError) return { status: 400, error: `Offering error id: ${offering.id} ` + offeringError.message };
315+
if (offeringError)
316+
return {
317+
status: 400,
318+
error: `Offering error id: ${offering.id} ` + offeringError.message,
319+
};
300320

301321
if (!offeringData || offeringData.length === 0) {
302322
return {
@@ -358,7 +378,10 @@ export const availableFunctions: AvailableFunctions = {
358378
.select("*");
359379

360380
if (courseEventError) {
361-
return { status: 400, error: "Coruse event error " + courseEventError.message };
381+
return {
382+
status: 400,
383+
error: "Coruse event error " + courseEventError.message,
384+
};
362385
}
363386
}
364387

0 commit comments

Comments
 (0)