From bf3b888e717766116c331cd8708b852e32131ab4 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Mon, 10 Jul 2023 21:29:25 -0300 Subject: [PATCH] No sincronizar subpedidos aprobados --- app/Http/Controllers/Api/SubpedidoController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Http/Controllers/Api/SubpedidoController.php b/app/Http/Controllers/Api/SubpedidoController.php index 3fe6987..a03e5ee 100644 --- a/app/Http/Controllers/Api/SubpedidoController.php +++ b/app/Http/Controllers/Api/SubpedidoController.php @@ -74,6 +74,8 @@ class SubpedidoController extends Controller // recibe request, saca producto y cantidad, valida, y pasa a syncProducto en Subpedido public function syncProductos(Subpedido $subpedido) { + if ($subpedido->aprobado) return new SubpedidoResource($subpedido); + $valid = request()->validate([ 'cantidad' => 'required|min:0', 'producto_id' => [