From 3b71c80be6c5041078ad97688acfb909b74a521e Mon Sep 17 00:00:00 2001 From: Gabriellvl Date: Fri, 7 Mar 2025 10:55:44 +0100 Subject: [PATCH] fix: consistente naamgeving --- backend/src/app.ts | 24 +++++++++---------- backend/src/controllers/assignments.ts | 4 ++-- .../routes/{assignment.ts => assignments.ts} | 0 backend/src/routes/{class.ts => classes.ts} | 6 ++--- backend/src/routes/{group.ts => groups.ts} | 0 ...learningObjects.ts => learning-objects.ts} | 0 .../{learningPaths.ts => learning-paths.ts} | 0 .../src/routes/{question.ts => questions.ts} | 0 .../src/routes/{student.ts => students.ts} | 0 .../routes/{submission.ts => submissions.ts} | 0 .../src/routes/{teacher.ts => teachers.ts} | 0 11 files changed, 17 insertions(+), 17 deletions(-) rename backend/src/routes/{assignment.ts => assignments.ts} (100%) rename backend/src/routes/{class.ts => classes.ts} (85%) rename backend/src/routes/{group.ts => groups.ts} (100%) rename backend/src/routes/{learningObjects.ts => learning-objects.ts} (100%) rename backend/src/routes/{learningPaths.ts => learning-paths.ts} (100%) rename backend/src/routes/{question.ts => questions.ts} (100%) rename backend/src/routes/{student.ts => students.ts} (100%) rename backend/src/routes/{submission.ts => submissions.ts} (100%) rename backend/src/routes/{teacher.ts => teachers.ts} (100%) diff --git a/backend/src/app.ts b/backend/src/app.ts index 83b4b998..811c6cfc 100644 --- a/backend/src/app.ts +++ b/backend/src/app.ts @@ -3,14 +3,14 @@ import { initORM } from './orm.js'; import { EnvVars, getNumericEnvVar } from './util/envvars.js'; import themeRoutes from './routes/themes.js'; -import learningPathRoutes from './routes/learningPaths.js'; -import learningObjectRoutes from './routes/learningObjects.js'; +import learningPathRoutes from './routes/learning-paths.js'; +import learningObjectRoutes from './routes/learning-objects.js'; -import studentRouter from './routes/student.js'; -import groupRouter from './routes/group.js'; -import submissionRouter from './routes/submission.js'; -import classRouter from './routes/class.js'; -import questionRouter from './routes/question.js'; +import studentRoutes from './routes/students.js'; +import groupRoutes from './routes/groups.js'; +import submissionRoutes from './routes/submissions.js'; +import classRoutes from './routes/classes.js'; +import questionRoutes from './routes/questions.js'; const app: Express = express(); const port: string | number = getNumericEnvVar(EnvVars.Port); @@ -23,11 +23,11 @@ app.get('/', (_, res: Response) => { }); }); -app.use('/student', studentRouter); -app.use('/group', groupRouter); -app.use('/submission', submissionRouter); -app.use('/class', classRouter); -app.use('/question', questionRouter); +app.use('/student', studentRoutes); +app.use('/group', groupRoutes); +app.use('/submission', submissionRoutes); +app.use('/class', classRoutes); +app.use('/question', questionRoutes); app.use('/theme', themeRoutes); app.use('/learningPath', learningPathRoutes); diff --git a/backend/src/controllers/assignments.ts b/backend/src/controllers/assignments.ts index 775a60df..feabb1e1 100644 --- a/backend/src/controllers/assignments.ts +++ b/backend/src/controllers/assignments.ts @@ -1,7 +1,7 @@ import { Request, Response } from 'express' import { getAssignment } from '../services/assignments'; -// typescript is annoywith with parameter forwarding from class.ts +// typescript is annoywith with parameter forwarding from classes.ts interface AssignmentParams { classid: string; id: string; @@ -27,4 +27,4 @@ export async function getAssignmentHandler( } res.json(assignment); -} \ No newline at end of file +} diff --git a/backend/src/routes/assignment.ts b/backend/src/routes/assignments.ts similarity index 100% rename from backend/src/routes/assignment.ts rename to backend/src/routes/assignments.ts diff --git a/backend/src/routes/class.ts b/backend/src/routes/classes.ts similarity index 85% rename from backend/src/routes/class.ts rename to backend/src/routes/classes.ts index bc502fb8..420018a4 100644 --- a/backend/src/routes/class.ts +++ b/backend/src/routes/classes.ts @@ -1,6 +1,6 @@ import express from 'express' import { getAllClassesHandler, getClassHandler, getClassStudentsHandler } from '../controllers/classes'; -import assignmentRouter from './assignment.js'; +import assignmentRouter from './assignments.js'; const router = express.Router(); @@ -12,7 +12,7 @@ router.get('/:id', getClassHandler); router.get('/:id/invitations', (req, res) => { res.json({ - invitations: [ + invitations: [ '0' ], }); @@ -22,4 +22,4 @@ router.get('/:id/students', getClassStudentsHandler); router.use('/:classid/assignments', assignmentRouter); -export default router \ No newline at end of file +export default router diff --git a/backend/src/routes/group.ts b/backend/src/routes/groups.ts similarity index 100% rename from backend/src/routes/group.ts rename to backend/src/routes/groups.ts diff --git a/backend/src/routes/learningObjects.ts b/backend/src/routes/learning-objects.ts similarity index 100% rename from backend/src/routes/learningObjects.ts rename to backend/src/routes/learning-objects.ts diff --git a/backend/src/routes/learningPaths.ts b/backend/src/routes/learning-paths.ts similarity index 100% rename from backend/src/routes/learningPaths.ts rename to backend/src/routes/learning-paths.ts diff --git a/backend/src/routes/question.ts b/backend/src/routes/questions.ts similarity index 100% rename from backend/src/routes/question.ts rename to backend/src/routes/questions.ts diff --git a/backend/src/routes/student.ts b/backend/src/routes/students.ts similarity index 100% rename from backend/src/routes/student.ts rename to backend/src/routes/students.ts diff --git a/backend/src/routes/submission.ts b/backend/src/routes/submissions.ts similarity index 100% rename from backend/src/routes/submission.ts rename to backend/src/routes/submissions.ts diff --git a/backend/src/routes/teacher.ts b/backend/src/routes/teachers.ts similarity index 100% rename from backend/src/routes/teacher.ts rename to backend/src/routes/teachers.ts