Science & Technology

#27 Project using Spring | Update and Delete

by Telusko

Share:

📚 Temas principales

  • Preparar la nueva interfazEl tutorial cambia a una interfaz que incluye opciones para actualizar y eliminar productos, y la ejecuta con npm. 0:00
  • Crear el endpoint de actualizaciónSe configura una petición PUT que recibe el ID en la URL y los datos del producto y la imagen. 3:08
  • Implementar la actualizaciónEl servicio asigna los bytes y el nombre de la imagen al producto antes de guardarlo mediante el método save del repositorio. 4:45
  • Crear el endpoint de eliminaciónSe configura una petición DELETE; el controlador comprueba si existe el producto y responde con un mensaje y el estado correspondiente. 7:22

✨ Conclusiones clave

  • Actualizar también puede crear productosEl método save puede insertar un producto si no existe, por lo que se puede comprobar previamente que el ID esté presente. 5:18
  • La imagen requiere tratamiento adicionalPara guardar una actualización con imagen, hay que asignar sus datos y nombre; la eliminación solo necesita el ID. 6:20

🧠 Lecciones aprendidas

  • Probar las operaciones desde la interfazSe comprueba que la actualización cambia la descripción, el stock y la categoría, y que la eliminación funciona al refrescar la página. 10:34
  • Guardar simplifica la actualizaciónEl repositorio puede actualizar el producto con save; sin gestionar una imagen, la lógica es más sencilla. 12:10

🏁 Conclusión y próximos pasos

  • Operaciones básicas completadasEl tutorial termina con las operaciones de actualización y eliminación, y anima a compartir otras formas de implementar la comprobación del producto. 12:10

Transcript excerpt

0:00 so once we have done with the create and read it's time to do the update and delete the thing is uh the UI which you are working with I'm not sure it has the update and delete feature I can't see that here so we'll be going for a new UI so we'll replace this first of all I will just stop this what was running here and let's open the new UI so I will go to file open and this is where I have all the UI now this is the latest one so this Ecom uh front end for I will upload

0:30 that in the I mean you will find the link in description I will open this and open so this is our new UI and we need to make it work so again the same steps which we have done before I will go to terminal I will click on new terminal and here I will say okay don't restart now npm install that's the first step the next step is we have to say npm uh run Dev okay so this is running I will click on this thing it is opening on some other page just take it here

🔒 The full, searchable transcript is available with Pro.

🔒 Unlock Premium Features

This is a premium feature. Upgrade to unlock unlimited Q&A, transcripts, mindmaps, and translations.

🔒 Unlock Premium Features

Access to Chat is a premium feature. Upgrade now to unlock unlimited studying tools.

🔒 Unlock Premium Features

Access to Mindmap is a premium feature. Upgrade now to unlock unlimited studying tools.

🔒 Unlock Premium Features

Access to Translation is a premium feature. Upgrade now to unlock unlimited studying tools.

Get unlimited summaries, Q&A, transcripts and more with Pro

Upgrade to Pro

Suggestions

🔒 Unlock Premium Features

Access to AI Suggestions is a premium feature. Upgrade now to unlock unlimited studying tools.