Skip to content

Commit

Permalink
add route to recieve form data
Browse files Browse the repository at this point in the history
relates #36
  • Loading branch information
LawEKS committed May 11, 2018
1 parent 0601274 commit 276274e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions src/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/views/profileDetails.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1>My Details</h1>
<form novalidate>
<form method="post" action="/saveDetails" novalidate>
<span>* Required</span>
<label for="full_name">Full Name *
<input id="full_name" name="full_name" type="text" required/>
Expand Down

0 comments on commit 276274e

Please sign in to comment.