Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 4, 2019 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/1314b5df7f691a94d3ea671350aeece1 to your computer and use it in GitHub Desktop.
Save parzibyte/1314b5df7f691a94d3ea671350aeece1 to your computer and use it in GitHub Desktop.
@PostMapping(value = "/quitar/{indice}")
public String quitarDelCarrito(@PathVariable int indice, HttpServletRequest request) {
ArrayList<ProductoParaVender> carrito = this.obtenerCarrito(request);
if (carrito != null && carrito.size() > 0 && carrito.get(indice) != null) {
carrito.remove(indice);
this.guardarCarrito(carrito, request);
}
return "redirect:/vender/";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment