krishnaacharyaa / wanderlust

WanderLust is a MERN travel blog website 🚀 This project is aimed to help people to contribute in open source, upskill in react and master git.
https://wanderlust-beta.vercel.app/
MIT License
221 stars 1.25k forks source link

[ENHANCEMENT] Adding user type in frontend #418

Closed devsharmagit closed 5 months ago

devsharmagit commented 5 months ago

Description

Right now frontend does not have a user type in the types folder. User types need to be added in the types folder for better type checking. and prevent future bugs.

Current Behavior

No user type in frontend types folderthe folder

Proposed Enhancement

add a user type on frontend type folder and use it everywhere.

Use Case

This will prevent future bugs and clean code format.

Blockers

No response

Additional Information/ Attachments

No response

AMS003010 commented 5 months ago

Hello @krishnaacharyaa 🤗

Please do assign me this issue under gssoc'24

Thank you

krishnaacharyaa commented 5 months ago

Hi @AMS003010, sure, In backend in one place there is this role type, you got to lift it up to the root level and have a type in a types folder if not already exists, same goes with frontend, and where ever there is "ADMIN" "USER" string hard coded, it needs to be replaced with the Role.User or Role.Admin .... take care of the naming conventions if needs to be upper case or lower case by referring to the other defined types in the project

github-actions[bot] commented 5 months ago

Hey @AMS003010 🎉! Thanks for jumping on this issue. Before you dive in, please check out our contributing guidelines to ensure we're all on the same page. Happy coding! 🚀

AMS003010 commented 5 months ago

@krishnaacharyaa I have made the PR Please do review it.

AMS003010 commented 5 months ago

@krishnaacharyaa I have made the PR Please do review it. Sorry 😅 for the delay, I was doubtful as to if the type should be applied for the mongo schema as well.

AMS003010 commented 5 months ago

@krishnaacharyaa I have made the fix, please do review it