Skip to content

Instantly share code, notes, and snippets.

@navarroaxel
Created November 23, 2016 22:07
Show Gist options
  • Save navarroaxel/70ed684c2e95990bf4be5b7a8fd5e13e to your computer and use it in GitHub Desktop.
Save navarroaxel/70ed684c2e95990bf4be5b7a8fd5e13e to your computer and use it in GitHub Desktop.
router.post('/:id/picture',
global.app.data.buckets({
bucket: 'pip-recreational-centers',
nameSuffix: req => '_' + req.params.id + '.png'
}),
(req, res, next) => model.RecreationalCenter.findById(req.params.id).then(
recreationCenter => {
recreationCenter.picture = req.resource.Location;
return playlist.save();
}
).then(
playlist => res.send({picture: recreationCenter.picture})
).catch(next)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment