Guest User

Untitled

a guest
Oct 23rd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. const get = (req, res) => {
  2. const { studentId } = req.params;
  3. const { name, year = 2018 } = req.query;
  4. if (studentId) {
  5. findOne(); // Acha 1 estudante pelo id dele rota GET | /students/:studentId
  6. }
  7. findAll(year, name); // Passa o nome e ano como filtro. Se nenhum ano for passado considera como default 2018
  8. }
Add Comment
Please, Sign In to add comment