Created a system to go directly to an assignment from a URL

This commit is contained in:
Tiago Ribeiro
2024-10-17 18:24:39 +01:00
parent a0a9402945
commit 4917583c67
10 changed files with 232 additions and 57 deletions

View File

@@ -9,3 +9,8 @@ export const getSessionsByUser = async (id: string, limit?: number) =>
.find<Session>({user: id})
.limit(limit || 0)
.toArray();
export const getSessionByAssignment = async (assignmentID: string) =>
await db
.collection("sessions")
.findOne<Session>({"assignment.id": assignmentID})