-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding the doctor in the admin #76
base: master
Are you sure you want to change the base?
Conversation
public/js/addDoctor.js
Outdated
@@ -0,0 +1,94 @@ | |||
// document.getElementsByClassName('form')[0].textContent = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the commented code
src/controllers/admin.js
Outdated
const { | ||
insertArticle, | ||
insertDoctor | ||
} = require('../model/queries/addData'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should first import others module then your modules and function so move this to be under bcrypt
src/controllers/index.js
Outdated
@@ -22,6 +22,9 @@ Router.route('/signIn') | |||
// Admin Routes | |||
Router.get('/admin', admin.get); | |||
Router.post('/admin/addArticle', admin.addArticle); | |||
Router.route('/addDoctor') | |||
.get(admin.addDoctor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better use destructing for admin
src/controllers/admin.js
Outdated
res.clearCookie('jwt'); | ||
res.redirect('/signIn'); | ||
} | ||
// console.log(res.locals.unlockCookie); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove all commented code from this file
public/js/addDoctor.js
Outdated
const name = document.querySelector('#name'); | ||
const email = document.querySelector('#email'); | ||
const password = document.querySelector('#password'); | ||
const addDoctorB = document.querySelector('#addDoctorB'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good comments 👍
so far this is the most readable file you upload 👍 💯
Fix the all the issue then you can merge this branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SalwaMugh fix admin.js in controller folder
src/controllers/admin.js
Outdated
res.redirect('/signIn'); | ||
} | ||
// console.log(res.locals.unlockCookie); | ||
// if (res.locals.unlockCookie.permission === 'admin') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now you can have those lines back as travis problem has been fixed
and don't forget to add this if (res.locals.unlockCookie && res.locals.unlockCookie.permission === 'admin') {
instead of this if (res.locals.unlockCookie.permission === 'admin') {
related to #55
-admin.js