From 35ead79a7faf8eb03dfe3184fdc3c2558a336f7f Mon Sep 17 00:00:00 2001 From: LeonardManon Date: Fri, 20 Sep 2024 14:13:15 +0200 Subject: [PATCH] code/English --- api/router/comments.js | 2 +- api/router/courses.js | 8 ++++---- api/router/topics.js | 12 ++++++------ api/router/users.js | 12 ++++++------ api/router/watches.js | 6 +++--- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/api/router/comments.js b/api/router/comments.js index 00cfcfd..6c87259 100644 --- a/api/router/comments.js +++ b/api/router/comments.js @@ -5,7 +5,7 @@ import validators from '../middlewares/validator.js'; const commentRouter = Router(); -// MESSAGE SUR UN SUJET DANS LE FORUM +// MESSAGE ON A SUBJECT IN THE FORUM // Create a message commentRouter.post( diff --git a/api/router/courses.js b/api/router/courses.js index 2babe5f..5f4138d 100644 --- a/api/router/courses.js +++ b/api/router/courses.js @@ -7,16 +7,16 @@ const courseRouter = Router(); // Fetch data from all courses courseRouter.get('/api/courses', coursesController.getAllCourses); -// Fetch data from a co +// Fetch data from a course by id courseRouter.get('/api/courses/:course_id(\\d+)', coursesController.getOneCourseById); -// Créer un cours +// create a course courseRouter.post('/api/courses', validators('courses'), coursesController.createCourse); -// Mettre à jour un cours +//update a course courseRouter.patch('/api/courses/:course_id(\\d+)',validators('courses'), coursesController.updateCourse); -// Supprimer un cours +// delete a course courseRouter.delete('/api/courses/:course_id(\\d+)', coursesController.deleteCourse); export { courseRouter }; diff --git a/api/router/topics.js b/api/router/topics.js index 230e3b6..92e744d 100644 --- a/api/router/topics.js +++ b/api/router/topics.js @@ -4,21 +4,21 @@ import validators from '../middlewares/validator.js'; const topicRouter = Router(); -// SUJET DANS LES FORUM +// SUBJECT IN THE FORUM -// Récupérer les informations de tous les sujets +// get all topics topicRouter.get('/api/topics', topicController.getAllTopics); -// Récupérer les informations d'un seul sujet via son id +// geta topic by id topicRouter.get('/api/topics/:topic_id(\\d+)', topicController.getOneTopicById); -// Créer un sujet +// create a topic topicRouter.post('/api/topics',validators('topics'), topicController.createTopic); -// Mettre à jour un sujet +// update a topic topicRouter.patch('/api/topics/:topic_id(\\d+)', topicController.updateTopic); -// Supprimer un sujet +// delete a topic topicRouter.delete('/api/topics/:topic_id(\\d+)', topicController.deleteTopic); export { topicRouter }; \ No newline at end of file diff --git a/api/router/users.js b/api/router/users.js index c846de0..d4c28c7 100644 --- a/api/router/users.js +++ b/api/router/users.js @@ -4,26 +4,26 @@ import validators from '../middlewares/validator.js'; const userRouter = Router(); -// Récupérer les informations de tous profils +// get all users userRouter.get('/api/users', userController.getAllUsers); -// Récupérer les informations d'un seul profil +// get a user by id userRouter.get('/api/users/:user_id(\\d+)', userController.getOneUserById); -// Récupérer les informations de tous les professeurs +// get all teachers userRouter.get('/api/teachers', userController.getAllTeachers); -// Créer un profil (inscription) +// create a user userRouter.post('/api/users', validators('users'), userController.createUser); -// Modifier les informations du profil +// update a user userRouter.patch( '/api/users/:user_id(\\d+)', validators('users'), userController.updateUser ); -// Supprimer un profil +// delete a user userRouter.delete('/api/users/:user_id(\\d+)', userController.deleteUser); export { userRouter }; diff --git a/api/router/watches.js b/api/router/watches.js index 7843b5a..2e0a665 100644 --- a/api/router/watches.js +++ b/api/router/watches.js @@ -3,16 +3,16 @@ import { watchesController } from '../controllers/watchesController.js'; const watchesRouter = Router(); -// Obtenir les cours commencés par un utilisateur +// get all watches watchesRouter.get('/api/watches/users/:user_id(\\d+)', watchesController.getAllWatchesByUserId); -// Ajouter un cours à la liste des cours commencés +// add a course to the list of courses started by a user watchesRouter.post( '/api/watches/courses/:course_id(\\d+)/users/:user_id(\\d+)', watchesController.createWatch, ); -// Supprimer un cours commencé (parce qu'on l'a fini en fait tavu) +// delete a course from the list of courses started by a user watchesRouter.delete( '/api/watches/courses/:course_id(\\d+)/users/:user_id(\\d+)', watchesController.deleteWatch,