Skip to content

Commit e2b590d

Browse files
committed
Update error code
1 parent 6cc9e7b commit e2b590d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

course-matrix/backend/src/controllers/sharesController.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default {
2929
// Query users for shared_id using email
3030
const { data: sharedUser, error: sharedError } = await supabase.rpc(
3131
"get_user_id_by_email",
32-
{ email: shared_email },
32+
{ email: shared_email }
3333
);
3434

3535
if (sharedError) {
@@ -39,7 +39,7 @@ export default {
3939
// Ensure sharedUser exists and is not an empty array
4040
if (!sharedUser || sharedUser.length === 0) {
4141
return res
42-
.status(404)
42+
.status(400)
4343
.json({ error: "User with provided email not found" });
4444
}
4545

@@ -106,7 +106,7 @@ export default {
106106
.schema("timetable")
107107
.from("shared")
108108
.select(
109-
"calendar_id, owner_id, timetables!inner(id, user_id, timetable_title, semester, favorite)",
109+
"calendar_id, owner_id, timetables!inner(id, user_id, timetable_title, semester, favorite)"
110110
)
111111
.eq("owner_id", user_id);
112112

@@ -140,7 +140,7 @@ export default {
140140
.schema("timetable")
141141
.from("shared")
142142
.select(
143-
"calendar_id, owner_id, timetables!inner(id, user_id, timetable_title, semester, favorite)",
143+
"calendar_id, owner_id, timetables!inner(id, user_id, timetable_title, semester, favorite)"
144144
)
145145
.eq("shared_id", user_id);
146146

0 commit comments

Comments
 (0)