Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const get = (req, res) => {
- const { studentId } = req.params;
- const { name, year = 2018 } = req.query;
- if (studentId) {
- findOne(); // Acha 1 estudante pelo id dele rota GET | /students/:studentId
- }
- findAll(year, name); // Passa o nome e ano como filtro. Se nenhum ano for passado considera como default 2018
- }
Add Comment
Please, Sign In to add comment