Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
301 B
3
Indexable
Never
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;
};
Leave a Comment