Created
January 11, 2020 19:34
-
-
Save PatrickKalkman/2e65bf0c4fe312499c5fb6871b2dd7fb to your computer and use it in GitHub Desktop.
Get a job
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jobController.getJob = function getJob(req, reply) { | |
const id = req.params.id; | |
Job.findById(id, function(err, job) { | |
if (!err) { | |
if (job) { | |
reply.send(job); | |
} else { | |
reply.notFound(`Could not find job with id ${id}`); | |
} | |
} else { | |
reply.badRequest(err); | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment