Conversation
ronyrosenberg
left a comment
There was a problem hiding this comment.
Hi,
The app is not running. Please update the readme file with instructions on how to run and its missing a FE application. Please make these changes and resubmit the eval. Make sure to remove files from the node modules as they were pushed as well.
| app.use(bodyParser.json()); | ||
|
|
||
| // Connect to MongoDB | ||
| mongoose.connect('mongodb://127.0.0.1:27017/Products') |
There was a problem hiding this comment.
Important, use lowercase for the DB. Mongo is case sensitive.
| mongoose.connect('mongodb://127.0.0.1:27017/Products') | |
| mongoose.connect('mongodb://127.0.0.1:27017/products') |
| const Product = require('../models/products'); | ||
| const Review = require('../models/reviews'); |
There was a problem hiding this comment.
convention says we should name our schema files in singular. Your schema represents one product and one review. Not many. Also, makes more sense.
| const Product = require('../models/products'); | |
| const Review = require('../models/reviews'); | |
| const Product = require('../models/product'); | |
| const Review = require('../models/review'); |
| ); | ||
| } | ||
|
|
||
| export default ProductList; |
| ); | ||
| } | ||
|
|
||
| export default Product; |
| } | ||
| }; | ||
|
|
||
| export default categoriesReducer; |
There was a problem hiding this comment.
duplicated name and doesn't seem to be in use
| <select | ||
| className="form-select" | ||
| value={sortByPrice} | ||
| onChange={(e) => { | ||
| setSortByPrice(e.target.value); | ||
| onSortChange(e.target.value); | ||
| }} | ||
| > | ||
| <option value="">Sort by Price</option> | ||
| <option value="lowest">Lowest to Highest</option> | ||
| <option value="highest">Highest to Lowest</option> | ||
| </select> | ||
| </div> | ||
| <div className="col-md-3"> | ||
| <select | ||
| className="form-select" | ||
| value={selectedCategory} | ||
| onChange={(e) => { | ||
| setSelectedCategory(e.target.value); | ||
| onCategoryChange(e.target.value); | ||
| }} | ||
| > | ||
| <option value="">All Categories</option> | ||
| {categories.map(category => ( | ||
| <option key={category} value={category}>{category}</option> | ||
| ))} |
There was a problem hiding this comment.
DRY.
You could have created a select component that takes the options to reuse twice: once for categories and once for sorting.
No description provided.