Skip to content
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
27e31fa
Update team.md
thomasyzy7 Jan 23, 2025
daad2a4
Merge pull request #3 from UTSC-CSCC01-Software-Engineering-I/develop
Austin-X Jan 25, 2025
761a7eb
This commit tests if the main branch actually blocks force-pushes
Austin-X Jan 29, 2025
70578b8
Revert "This commit tests if the main branch actually blocks force-pu…
Austin-X Jan 29, 2025
a21f3e3
Release/0.1 - Main (#14)
thomasyzy7 Feb 1, 2025
ff98df3
[Hotfix]: Add missing section in README.md for "Tech Stack and Softwa…
Austin-X Feb 1, 2025
5024884
Release/1.0 - Main (#30)
thomasyzy7 Feb 15, 2025
813595b
Added Sprint0 Rubric + Grades + Deductions (#39)
prokopchukdim Feb 20, 2025
6def085
Added Sprint 1 Rubric / Grades (#49)
prokopchukdim Mar 2, 2025
fccb706
Merge branch 'main' into release/1.2
Austin-X Mar 8, 2025
9f8cde4
Auto-formatted the code using Prettier
Austin-X Mar 8, 2025
3adc27c
Fix typo
Austin-X Mar 8, 2025
2699f2a
Release/1.2 - Main (#60)
thomasyzy7 Mar 8, 2025
4cb5b39
Improved querying of year level and breadth requirement from vector db
kevin-lann Mar 10, 2025
f06912f
Auto-formatted the code using Prettier
kevin-lann Mar 10, 2025
7821a3a
Merge branch 'kl/scrum-132-refine-ai-outputs' of https://github.com/U…
minhhaitran08 Mar 11, 2025
aabd2f4
Merge branch 'main' of https://github.com/UTSC-CSCC01-Software-Engine…
minhhaitran08 Mar 12, 2025
eca6fc9
Update Create and get timetable end points to include favorite field
minhhaitran08 Mar 12, 2025
ef9771b
Auto-formatted the code using Prettier
minhhaitran08 Mar 12, 2025
74b36fc
Update endpoints to check for duplicated names
minhhaitran08 Mar 13, 2025
dcb5591
Fix typo
minhhaitran08 Mar 15, 2025
b816af2
Fix incorrect commit so that this branch only contain check timetable…
minhhaitran08 Mar 16, 2025
5c28f25
Auto-formatted the code using Prettier
minhhaitran08 Mar 16, 2025
08b9b48
Fix incorrect commit
minhhaitran08 Mar 16, 2025
94d69ed
Merge branch 'mt/scrum-137-check-timetable-duplicated-name' of https:…
minhhaitran08 Mar 16, 2025
4d28b1c
Merge branch 'develop' into mt/scrum-137-check-timetable-duplicated-name
minhhaitran08 Mar 16, 2025
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
20 changes: 20 additions & 0 deletions course-matrix/backend/src/controllers/timetablesController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,26 @@ export default {
.json({ error: "timetable title and semester are required" });
}

// Check if a timetable with the same title already exist for this user
const { data: existingTimetable, error: existingTimetableError } =
await supabase
.schema("timetable")
.from("timetables")
.select("id")
.eq("user_id", user_id)
.eq("timetable_title", timetable_title)
.maybeSingle();

if (existingTimetableError) {
return res.status(400).json({ error: existingTimetableError.message });
}

if (existingTimetable) {
return res
.status(400)
.json({ error: "A timetable with this title already exists" });
}

//Create query to insert the user_id and timetable_title into the db
let insertTimetable = supabase
.schema("timetable")
Expand Down