From 276274ec03e6ac8cd940ae84a6e5cd43f9eed919 Mon Sep 17 00:00:00 2001 From: Lawrence Sarpong Date: Fri, 11 May 2018 13:11:38 +0100 Subject: [PATCH] add route to recieve form data relates #36 --- src/controllers/index.js | 19 +++++++++++++++++++ src/views/profileDetails.hbs | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/controllers/index.js b/src/controllers/index.js index fadd7a6..57d30dc 100644 --- a/src/controllers/index.js +++ b/src/controllers/index.js @@ -19,6 +19,25 @@ router.get('/myprofile', ensureAuthenticated, (req, res) => { }); router.get('/myprofile/mydetails/edit', ensureAuthenticated, profileDetails.get); +router.get('/temp', profileDetails.get); + +router.post('/saveDetails', (req, res) => { + console.log('trying to save'); + const formData = req.body; + /* + { + "full_name": "aaaa", + "github_handle": "bbbbbb", + "fac_campus": "London", + "fac_number": "0", + "tech_stack": "JavaScript", + "linkedin_url": "a", + "twitter_handle": "a" + } + */ + res.send(formData); +}); + // AUTHENTICATION ROUTES // router.get( '/auth/github/signup', diff --git a/src/views/profileDetails.hbs b/src/views/profileDetails.hbs index 280b2a6..d2ebe38 100644 --- a/src/views/profileDetails.hbs +++ b/src/views/profileDetails.hbs @@ -1,5 +1,5 @@

My Details

-
+ * Required