Untitled
unknown
plain_text
2 years ago
301 B
6
Indexable
const updateProductName = async (id, name) => {
const product = await productsModel.findById(id);
if (!product) {
throw new Error('Product not found');
}
await productsModel.updateProductName(id, name);
const updatedProduct = await productsModel.findById(id);
return updatedProduct;
};Editor is loading...
Leave a Comment