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

Added register-admin route, reading json data from body #94

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

dhananjaysingh10
Copy link
Contributor

Issue #76
solved the problem, admin data saving multiple time in DB
Added register-admin route
Saving password in encrypted form in DB
I have improved my code, please let me no if there are some error. I will try my best to fix them.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Great job, @dhananjaysingh10! 🎉 Thank you for submitting your pull request. Your contribution is valuable and we appreciate your efforts to improve our project.

We will promptly review your changes and offer feedback. Keep up the excellent work! Kindly remember to check our contributing guidelines

@dhananjaysingh10
Copy link
Contributor Author

dhananjaysingh10 commented May 17, 2024

Sorry I closed the last PR by mistake, This PR has no merge conflict, also ADMIN Data is NOT Saved multiple times in DB. Also there is no hard coded value now. to access the admin page first we have to Register then only we can login to admin dashboard

@Sahil1786
Copy link
Owner

Show me some images

@dhananjaysingh10
Copy link
Contributor Author

dhananjaysingh10 commented May 17, 2024

Pls check the attached images in sequence

  1. Shown already registered user in MongoDB
    Screenshot (59)

  2. Trying to re register show error " Already registered, please login "
    Screenshot (60)

  3. Then i registered new user,
    Screenshot (61)

  4. only one entry is created also you can not re register using that email
    Screenshot (62)

  5. response of /admin-login, showing successful login
    Screenshot (63)

  6. response of /admin-login when data is invalid or not found in DB
    Screenshot (64)

@dhananjaysingh10
Copy link
Contributor Author

Sir there is no username, in user schema,
email
password
fullName
Mobile should we add it to schema, also register-admin route can be improved base on field required to register user and adding refresh token for validation , file upload like avatar for user.

All the schemas should be defined more precisely for ease of other developer so we do not need to revise the same portion of code again and again as our schema changes
If you can provide the requirements i can design the schema on figma, after validation we can update the models code also.

@Sahil1786 Sahil1786 force-pushed the main branch 2 times, most recently from 4b2ad23 to 8bd2b29 Compare May 20, 2024 18:23
@dhananjaysingh10
Copy link
Contributor Author

Hello @Sahil1786 please let me know if there is any problem in the code

@Sahil1786
Copy link
Owner

branch has conflicts that must be resolved

@dhananjaysingh10
Copy link
Contributor Author

dhananjaysingh10 commented May 30, 2024

@Sahil1786 please check it does not have any conflict right now

@dhananjaysingh10
Copy link
Contributor Author

@Sahil1786 Please check my work and suggest changes if needed.
and I want to work on this part of the project suggested earlier in the comments
there is no username, in the user schema,
email
password
fullName
Mobile should we add it to the schema, also, the register-admin route can be improved based on the field required to register the user adding a refresh token for validation, and file upload like an avatar for the user and admin.

All the schemas should be defined more precisely for the ease of other developers so we do not need to revise the same portion of code again and again as our schema changes
If you can provide the requirements I can design the schema, after validation we can update the MongoDB models also.

@Sahil1786 Sahil1786 merged commit f465730 into Sahil1786:main Jun 3, 2024
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