Skip to content
Merged
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
4 changes: 2 additions & 2 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"version": "1.0.0",
"dependencies": {
"@hono/zod-validator": "^0.4.3",
"@prisma/client": "^5.20.0",
"@prisma/client": "5.22.0",
"common": "workspace:common",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
Expand All @@ -41,7 +41,7 @@
"@types/cookie-parser": "^1.4.7",
"@types/cors": "^2.8.17",
"globals": "^15.8.0",
"prisma": "^5.11.0",
"prisma": "5.22.0",
"typescript": "^5.4.5",
},
},
Expand Down
4 changes: 2 additions & 2 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"license": "ISC",
"dependencies": {
"@hono/zod-validator": "^0.4.3",
"@prisma/client": "^5.20.0",
"@prisma/client": "5.22.0",
"common": "workspace:common",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
Expand All @@ -34,7 +34,7 @@
"@types/cookie-parser": "^1.4.7",
"@types/cors": "^2.8.17",
"globals": "^15.8.0",
"prisma": "^5.11.0",
"prisma": "5.22.0",
"typescript": "^5.4.5"
},
"trustedPackages": ["prisma"]
Expand Down
2 changes: 1 addition & 1 deletion server/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "debian-openssl-3.0.x"]
previewFeatures = ["typedSql"]
previewFeatures = ["typedSql","relationJoins"]
}

datasource db {
Expand Down
1 change: 1 addition & 0 deletions server/src/database/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ export const prisma = new PrismaClient(
prisma.$on("query", (e) => {
console.log(format(e.query, { language: "postgresql" }));
console.log(`Params: ${e.params}`);
console.log(`Duration: ${e.duration}`);
console.log("\n");
});
1 change: 0 additions & 1 deletion server/src/database/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export async function getPendingRequestsToUser(
include: {
course: {
include: {
enrollments: true,
slots: true,
},
},
Expand Down
3 changes: 0 additions & 3 deletions server/src/database/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export async function getUser(guid: GUID): Promise<UserWithCoursesAndSubjects> {
include: {
course: {
include: {
enrollments: true,
slots: true,
},
},
Expand Down Expand Up @@ -84,7 +83,6 @@ export async function getUserByID(
include: {
course: {
include: {
enrollments: true,
slots: true,
},
},
Expand Down Expand Up @@ -147,7 +145,6 @@ export async function getAllUsers(): Promise<
include: {
course: {
include: {
enrollments: true,
slots: true,
},
},
Expand Down
2 changes: 1 addition & 1 deletion server/src/firebase/auth/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type DecodedIdToken = admin.DecodedIdToken;
// THROWS: if idToken is not present in request cookie, or when the token is not valid.
export async function getGUID(c: Context): Promise<GUID> {
const idToken = c.req.header("Authorization");
if (typeof idToken !== "string") error("token not found in query", 401);
if (typeof idToken !== "string") error("token not found in header", 401);
return await getGUIDFromToken(idToken);
}

Expand Down
1 change: 1 addition & 0 deletions server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if (corsOptions.origin.length > 1) {
const app = new Hono()
.onError((err, c) => {
if (err instanceof HTTPException) {
console.error(err);
c.status(err.status);
return c.json({ error: err });
}
Expand Down