Skip to content

Instantly share code, notes, and snippets.

@PatrickKalkman
Created January 11, 2020 19:34
Show Gist options
  • Save PatrickKalkman/2e65bf0c4fe312499c5fb6871b2dd7fb to your computer and use it in GitHub Desktop.
Save PatrickKalkman/2e65bf0c4fe312499c5fb6871b2dd7fb to your computer and use it in GitHub Desktop.
Get a job
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