Skip to content

Instantly share code, notes, and snippets.

@umutyerebakmaz
Created April 2, 2021 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save umutyerebakmaz/3536dc03752342345e1e8d353cdd9ff2 to your computer and use it in GitHub Desktop.
Save umutyerebakmaz/3536dc03752342345e1e8d353cdd9ff2 to your computer and use it in GitHub Desktop.
export const deleteProduct = async (req, res, next) => {
const response = await productModel.findByIdAndRemove(req.params.productId);
if (!response) {
return next(res.status(200).json({
success: false,
message: 'ürün bulunamadı'
}));
}
else return next(res.status(200).json({
success: true,
message: 'ürün silindi'
}));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment