Controller for adding magnets from post body magnet variable.

This commit is contained in:
2017-10-21 15:28:13 +02:00
parent 4c7be51a61
commit 5a24837163

View File

@@ -0,0 +1,23 @@
/*
* @Author: KevinMidboe
* @Date: 2017-10-21 09:54:31
* @Last Modified by: KevinMidboe
* @Last Modified time: 2017-10-21 15:22:40
*/
const PirateRepository = require('src/pirate/pirateRepository');
function updateRequested(req, res) {
const magnet = req.body.magnet;
PirateRepository.AddMagnet(magnet)
.then((result) => {
res.send({result);
})
.catch((error) => {
res.status(401).send({ success: false, error: error.message });
});
}
module.exports = updateRequested;