Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code/English #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion api/router/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions api/router/courses.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
12 changes: 6 additions & 6 deletions api/router/topics.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
12 changes: 6 additions & 6 deletions api/router/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
6 changes: 3 additions & 3 deletions api/router/watches.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down