Next.js 13 Full Stack E-commerce App #27 | Update Product, Delete Product & it's Images
Вставка
- Опубліковано 18 тра 2023
- Git Repo Link:
github.com/ghulamabbas2/buyit...
Checkout my In-Depth Next.js Masterclass on Udemy Courses:
www.udemy.com/course/nextjs-b...
Next.js Authentication with Next-Auth:
• Next.js Authentication...
================================================================
⚙️ Gadgets I use for Recording:
💻 Laptop - Macbook PRO M1 - 16/512
amzn.to/4eUqrSe
🎤 MIC - Samson Technologies Q2U USB/XLR Dynamic Microphone
amzn.to/3W9Z4wl
🖱️Mouse - Logitech G402 Gaming Mouse Hyperion Fury USB, Black
amzn.to/3RY4xUy
⌨️ Keyboard - Logitech K380 Multi-Device Bluetooth Keyboard
amzn.to/3RY4Fn0
🖥️ Monitor - UltraSharp 24-Inch Screen Led-Lit Monitor (U2419H)
amzn.to/4bxidN6
================================================================
In this tutorial, we will continue building our full-stack e-commerce application using Next.js 13. Today, we will be focusing on updating and deleting products, along with their corresponding images.
You'll learn how to implement edit and delete functionality, enabling users to modify or remove products. We will also cover the process of deleting images from Cloudinary, ensuring that your storage stays organized and free of unnecessary clutter.
With the help of our step-by-step guide, you'll be able to seamlessly update and delete products in your Next.js e-commerce app.
Don't miss out on this informative tutorial!
LIKE, SHARE & SUBSCRIBE!
Love From Bangladesh.. Brother
Hello Abbas, we could not reach our message to you in order to tell you that we had an issue with series #25
Please check that comment, I have responded there.
Wel explained sir
Thanks mate.
I'm getting this error:
components/admin/UploadImages.jsx (35:2) @ useEffect
33 | };
34 |
> 35 | useEffect(() => {
Can you download the code and try to run as is?
Then if you fix the useEffect, the variable updated is not defined in the UploadImages.jsx
Thanks
Can you share the full error.
@@codingwithabbas the variable updated is not defined. It only appears once in the UploadImages.jsx. It gives me that error.
Unhandled Runtime Error
ReferenceError: useEffect is not defined
Source
components/admin/UploadImages.jsx (35:2) @ useEffect
33 | };
34 |
> 35 | useEffect(() => {
| ^
36 | if (error) {
37 | toast.error(error);
38 | clearErrors();
ReferenceError: useEffect is not defined
at UploadImages (webpack-internal:///(sc_client)/./components/admin/UploadImages.jsx:43:5)
at renderWithHooks (/Users/e1206176/codigo/abbas/buyitnow-028-update-delete-product 2/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.development.js:7756:16)
at renderIndeterminateComponent (/Users/e1206176/codigo/abbas/buyitnow-028-update-delete-product 2/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.development.js:7830:15)
file: github.com/ghulamabbas2/buyitnow/blob/028-update-delete-product/components/admin/UploadImages.jsx
variable not defined: updated
All the imports seems to be ok.
@@AfonsoFilipeJr replace "const { uploadProductImages, error, loading, clearErrors } =
useContext(ProductContext);" by "const { uploadProductImages, error, loading, updated, clearErrors } =
useContext(ProductContext);" in UploadImages.jsx
@@adityakaustavdas6307 was about to say the same. That's the fix.
Mr Abbas please fix this on your code.
😉
Hi Abbas, thanks so much for your time and effort, but there are some of us are still stuck on #25 - we've left multiple comments, tried using your repo (same results) and have yet to receive any response from you on this unhelpful error message we are receiving ('POST 400 (Bad Request) */api/admin/products ' - this is happening whether we use our own or your course repo)- could you check mine and @akhror-oshie's comments there please? We can't proceed past that point as we are unable to create new products.
Many thanks
Terry
Check that comment. I've replied there.