From 25cf83a8bb1339b8b9f4307191ae1fbbe5cc7165 Mon Sep 17 00:00:00 2001 From: Jack <jack.stuart@connect.qut.edu.au> Date: Fri, 11 Apr 2014 09:48:38 +1000 Subject: [PATCH] Added Route for profile update --- controllers/profiles.js | 8 +++++++- public/dist/app.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/controllers/profiles.js b/controllers/profiles.js index 97342dd..330e58d 100644 --- a/controllers/profiles.js +++ b/controllers/profiles.js @@ -13,5 +13,11 @@ module.exports = function(app) { return res.apiSuccess(profile); }); }); + app.put('/api/profiles/:profileid', auth.check(), function(req, res) { + Profile.findByIdAndUpdate(req.params.profileid, req.body, function (err, profile) { + if (err) return handleError(err); + return res.apiSuccess("Your profile has been updated", profile); + }); +}); +}; -}; \ No newline at end of file diff --git a/public/dist/app.js b/public/dist/app.js index 383dd02..7444d64 100644 --- a/public/dist/app.js +++ b/public/dist/app.js @@ -1,5 +1,5 @@ /** - * internlabs - v0.1.0 - 2014-04-10 + * internlabs - v0.1.0 - 2014-04-11 * */ /**