Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/controllers/productController.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const deleteProduct = asyncHandler(async (req, res) => {
const product = await Product.findById(req.params.id)

if (product) {
await product.remove()
await product.deleteOne()
res.json({ message: 'Product removed' })
} else {
res.status(404)
Expand Down
2 changes: 1 addition & 1 deletion backend/controllers/userController.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const deleteUser = asyncHandler(async (req, res) => {
const user = await User.findById(req.params.id)

if (user) {
await user.remove()
await user.deleteOne
res.json({ message: 'User removed' })
} else {
res.status(404)
Expand Down