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

Needs Attention please! #16

Open
sleekLancelot opened this issue Oct 9, 2020 · 0 comments
Open

Needs Attention please! #16

sleekLancelot opened this issue Oct 9, 2020 · 0 comments

Comments

@sleekLancelot
Copy link

Also, when we hit 'GET /api/v1/citizen/profile/:id'
the id parameter in the req will course a lot of problems, its suppose to be a the citizen._id right?
but i can't get the citizen details until this code runs const citizen = await Citizens.findOne({ _id: req.params.id });
And that code only runs on a GET request to /api/v1/citizen/profile/:id which requires a param of the citizen id,whc i dont have yet

so i suggest you change the controller url from /api/v1/citizen/profile/:id to /api/v1/citizen/profile
And
const citizen = await Citizens.findOne({ _id: req.params.id });
to something like :
const citizen= await Citizens.findById(req.user, '-password'); res.json({ citizen});

Originally posted by @sleekLancelot in #13 (comment)

udofia2 added a commit that referenced this issue Oct 22, 2020
@udofia2 udofia2 mentioned this issue Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant