Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

adding the doctor in the admin #76

wants to merge 2 commits into from

Conversation

SalwaMugh
Copy link
Collaborator

@SalwaMugh SalwaMugh commented Sep 20, 2018

related to #55

  • demodoctor.hbs => will be modified to take a place in admin.hbs
  • addDoctor.js
  • query
    -admin.js

@@ -0,0 +1,94 @@
// document.getElementsByClassName('form')[0].textContent = '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the commented code

const {
insertArticle,
insertDoctor
} = require('../model/queries/addData');
Copy link
Contributor

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

@@ -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)
Copy link
Contributor

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

res.clearCookie('jwt');
res.redirect('/signIn');
}
// console.log(res.locals.unlockCookie);
Copy link
Contributor

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

const name = document.querySelector('#name');
const email = document.querySelector('#email');
const password = document.querySelector('#password');
const addDoctorB = document.querySelector('#addDoctorB');
Copy link
Contributor

@MohammedYehia MohammedYehia Sep 20, 2018

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 👍 💯

@MohammedYehia
Copy link
Contributor

Fix the all the issue then you can merge this branch

Copy link
Contributor

@MohammedYehia MohammedYehia left a 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

res.redirect('/signIn');
}
// console.log(res.locals.unlockCookie);
// if (res.locals.unlockCookie.permission === 'admin') {
Copy link
Contributor

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') {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants