We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 95785c1 commit 5045478Copy full SHA for 5045478
1 file changed
app/(dashboard)/admin/products/[id]/page.tsx
@@ -49,7 +49,16 @@ const DashboardProductDetails = ({
49
50
// functionality for updating product
51
const updateProduct = async () => {
52
- console.log(product);
+ if (
53
+ product?.title === "" ||
54
+ product?.slug === "" ||
55
+ product?.price.toString() === "" ||
56
+ product?.manufacturer === "" ||
57
+ product?.description === ""
58
+ ) {
59
+ toast.error("You need to enter values in input fields");
60
+ return;
61
+ }
62
63
const requestOptions = {
64
method: "PUT",
0 commit comments