Skip to content
Snippets Groups Projects
Commit f6f6cd8b authored by michael.minelli's avatar michael.minelli
Browse files

ExerciseManager => Update the get function to accept git url in addition of id

parent e3ed17f1
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,9 @@ import db from '../helpers/DatabaseHelper'; ...@@ -4,7 +4,9 @@ import db from '../helpers/DatabaseHelper';
class ExerciseManager { class ExerciseManager {
async get(id: string, include: Prisma.ExerciseInclude | undefined = undefined): Promise<Exercise | undefined> { async get(idOrUrl: string, include: Prisma.ExerciseInclude | undefined = undefined): Promise<Exercise | undefined> {
const id = idOrUrl.replace('.git', '').split('_').pop()!;
return await db.exercise.findUnique({ return await db.exercise.findUnique({
where : { where : {
id: id id: id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment