Enhance Mongoose Schemas: Improved Validation and Security #351
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #349
This pull request introduces enhancements and optimizations to several Mongoose schema files within the project, including
blog.js
,contact.js
,feedback.js
,newsletter.js
,profile.js
,project.js
,user.js
, andavatar.js
. The changes aim to improve data validation, security, and overall schema clarity.This PR deserves level3, Kindly review it and add the level accordingly! @Anuj3553
Changes Made:
blog.js
email
field for validation.category
field for better classification of blog posts.contact.js
feedback.js
rating
to ensure it falls within a defined range.newsletter.js
email
field.profile.js
email
,phone
, and social links.role
field to handle user roles (user/admin).image
field toimageUrl
for better understanding.timestamps
for tracking creation and updates.project.js
imageUrl
for clarity.gitHubLink
andyouTubeLink
.status
field to track the project state (In Progress, Completed).user.js
image
field toimageUrl
for clarity.role
field to differentiate user access levels.timestamps
for better record-keeping.avatar.js
image
field toimageUrl
for clarity.imageUrl
field required and added validation regex.timestamps
to track avatar creation and updates.