Created
November 23, 2016 22:07
-
-
Save navarroaxel/70ed684c2e95990bf4be5b7a8fd5e13e to your computer and use it in GitHub Desktop.
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
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