Skip to content

FE+BE product list#159

Open
lesavantdon wants to merge 16 commits intoprojectshft:masterfrom
lesavantdon:master
Open

FE+BE product list#159
lesavantdon wants to merge 16 commits intoprojectshft:masterfrom
lesavantdon:master

Conversation

@lesavantdon
Copy link

No description provided.

Comment on lines +6 to +10
router.get('/', productController.getAllProducts);
router.get('/:id', productController.getProductById);
router.post('/', productController.createProduct);
router.put('/:id', productController.updateProduct);
router.delete('/:id', productController.deleteProduct);

Choose a reason for hiding this comment

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

very clear and good organization

Comment on lines +9 to +11
if (category && category !== 'all') {
query.category = category;
}

Choose a reason for hiding this comment

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

Suggested change
if (category && category !== 'all') {
query.category = category;
}
query.category = category !== 'all' ? category : null;

name: { type: String, required: true },
description: { type: String, required: true },
price: { type: Number, required: true },
category: { type: String, required: true },

Choose a reason for hiding this comment

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

ideally we would want to limit categories and use an enum or some specific ones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants