Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .get((req ,res) => {
- if (req.params.include && req.params.include) {
- db.models.model[req.params.model].findById(req.params.id, {include:req.params.include})
- .then((data) => {
- res.json(data);
- }).catch((err) => {
- res.status(500).end();
- console.log(err);
- });
- } else {
- db.models.model[req.params.model].findById(req.params.id,)
- .then((data) => {
- res.json(data);
- }).catch((err) => {
- res.status(500).end();
- console.log(err);
- });
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement