ISIL-ESTE / Student-Workflow-Organizer

The Workflow Organizer website helps students to organize their academic workload through features such as a dashboard, timeline, reminders, collaboration tools, resource library, progress tracking, and analytics. It also allows users to share and summarize courses and seek project help.
MIT License
47 stars 21 forks source link

missing file base_controller in routes #136

Closed GiovanniCaiazzo01 closed 1 year ago

GiovanniCaiazzo01 commented 1 year ago

Hi,

in backend-app/routes/calendar_routes there is an import for base_controller in the same folder, but actually, this file does not exist, I found another file called base_controller but is under the folder controllers.

does the import at row 2 actually refer to the base_controller in controllers?

const express = require('express');
const base = require('./base_controller');
const calendarModel = require('../models/calendar/calendar_model');
const authController = require('../controllers/auth_controllers/auth_controller');
const router = express.Router();

router.post('/', base.createOne(calendarModel));
router.get('/:id', base.getOne(calendarModel));

router.patch('/:id', base.updateOne(calendarModel));
router.delete('/:id', base.deleteOne(calendarModel));

router.use(authController.restrictTo('ADMIN', 'SUPER_ADMIN'));

router.get('/', base.getAll(calendarModel));

module.exports = router;
bellaabdelouahab commented 1 year ago

i see what you mean the base controller is the targeted one the new import when converted to ts should be : import * as base from '@controllers/base_controller';

@GiovanniCaiazzo01

GiovanniCaiazzo01 commented 1 year ago

Perfect, thanks for clarifying my doubts. @bellaabdelouahab