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

Improve campground.js Schema with Validation, Timestamps, and Error Logging #361

Closed
smog-root opened this issue Nov 2, 2024 · 3 comments

Comments

@smog-root
Copy link
Contributor

Suggested Enhancements:

1. Add Validation Constraints:

  • Ensure title has a minimum length to avoid short or empty titles (e.g., { minlength: 3 }).
  • Ensure price is positive to prevent incorrect values (e.g., { min: 0 }).

2. Include Timestamps:

  • Add { timestamps: true } to the CampgroundSchema to track when a campground was created or last updated.

3. Enhance Error Logging:

  • Improve error handling in the findOneAndDelete middleware by adding more detailed logs or notifications for better debugging.

Benefits:

  • Enhanced data validation and integrity.
  • Improved tracking of campground updates and additions.
  • Better error insights for debugging.

I'm expecting a gssoc-ext with level labels! @Vignesh025

@github-actions github-actions bot added bug Something isn't working enhancement New feature or request gssoc-ext labels Nov 2, 2024
@kuhupatel15
Copy link

I can work on this by implementing error handling using try catch and conditions on attributes of campground model. Please assign it to me. @Vignesh025

@smog-root
Copy link
Contributor Author

I can work on this by implementing error handling using try catch and conditions on attributes of campground model. Please assign it to me. @Vignesh025

I have already raised the issue!!

You can create your own issue and work on it!! @kuhupatel15

@Vignesh025
Copy link
Contributor

@smog-root , you can proceed!

@Vignesh025 Vignesh025 added hacktoberfest-accepted level2 and removed bug Something isn't working enhancement New feature or request labels Nov 3, 2024
@Vignesh025 Vignesh025 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants