-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Conditionally rendering instructor registration
- Loading branch information
1 parent
faf98b4
commit 6df5716
Showing
5 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
const { Router } = require('express'); | ||
const { profilePrefix } = require('../../configs'); | ||
const { profilePrefix, instructorPrefix } = require('../../configs'); | ||
const { renderUserProfileController } = require('../controllers'); | ||
const { isLoggedInUser } = require('../middleware'); | ||
|
||
const router = Router(); | ||
|
||
router.get(profilePrefix, isLoggedInUser, renderUserProfileController); | ||
router.get(instructorPrefix, (req, res) => | ||
res.status(200).render('users/instructor') | ||
); | ||
|
||
module.exports = router; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<section> | ||
<form action="/instructor" method="post"> | ||
<button type="submit">Become Instructor</button> | ||
</form> | ||
</section> |