Skip to content

Commit 6713158

Browse files
committed
Fix: Correccion de error de rutas de consumo en modulo inventario frontend
1 parent a950bed commit 6713158

10 files changed

Lines changed: 16 additions & 16 deletions

Frontend/app/Http/Controllers/Inventario/IngredientesController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public function index()
3434

3535
// Proveedores y categorías (los que ya tienes)
3636
try {
37-
$proveedores = Http::get('http://localhost:8080/proveedores')->json() ?? [];
38-
$categorias = Http::get('http://localhost:8080/categorias/ingredientes')->json() ?? [];
39-
$unidades = Http::get('http://localhost:8080/unidades-medida')->json() ?? []; // ← nuevo
37+
$proveedores = Http::get('http://32.193.167.191:8080/proveedores')->json() ?? [];
38+
$categorias = Http::get('http://32.193.167.191:8080/categorias/ingredientes')->json() ?? [];
39+
$unidades = Http::get('http://32.193.167.191:8080/unidades-medida')->json() ?? []; // ← nuevo
4040
} catch (\Exception $e) {
4141
$proveedores = $categorias = $unidades = [];
4242
}
@@ -69,7 +69,7 @@ public function store(Request $request)
6969
$request->validate([
7070
'idProveedor' => 'required|integer',
7171
'idCategoria' => 'required|integer',
72-
'idUnidadMedida' => 'required|integer', // ⬅️ AGREGAR ESTA VALIDACIÓN
72+
'idUnidadMedida' => 'required|integer',
7373
'nombreIngrediente' => 'required|string|max:255',
7474
'referenciaIngrediente' => 'required|string|max:50',
7575
]);

Frontend/app/Http/Controllers/Inventario/PedidosProveedoresController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public function index()
2727
$pedidos = $response['success'] ? ($response['data'] ?? []) : [];
2828

2929
try {
30-
$proveedores = Http::get('http://localhost:8080/proveedores')->json() ?? [];
31-
$ingredientes = Http::get('http://localhost:8080/ingredientes/lista')->json() ?? [];
30+
$proveedores = Http::get('http://32.193.167.191:8080/proveedores')->json() ?? [];
31+
$ingredientes = Http::get('http://32.193.167.191:8080/ingredientes/lista')->json() ?? [];
3232
} catch (\Exception $e) {
3333
$proveedores = [];
3434
$ingredientes = [];
@@ -102,7 +102,7 @@ public function show(int $id)
102102
$pedido = $response['data'];
103103

104104
try {
105-
$proveedores = Http::get('http://localhost:8080/proveedores')->json() ?? [];
105+
$proveedores = Http::get('http://32.193.167.191:8080/proveedores')->json() ?? [];
106106
} catch (\Exception $e) {
107107
$proveedores = [];
108108
}

Frontend/app/Http/Controllers/Inventario/RecetasController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function index()
2626
$productos = $this->productosService->obtenerProductos();
2727

2828
try {
29-
$responseIng = Http::get('http://44.195.189.38:8080/recetas/lista-modal');
29+
$responseIng = Http::get('http://32.193.167.191:8080/recetas/lista-modal');
3030
$ingredientesParaModal = $responseIng->successful() ? $responseIng->json() : [];
3131
} catch (\Exception $e) {
3232
$ingredientesParaModal = [];
@@ -49,7 +49,7 @@ public function show($idProducto)
4949

5050
// ✅ Cargar ingredientes para el select del modal de edición
5151
try {
52-
$responseIng = Http::get('http://http://44.195.189.38:8080/recetas/lista-modal');
52+
$responseIng = Http::get('http://32.193.167.191:8080/recetas/lista-modal');
5353
$ingredientes = $responseIng->successful() ? $responseIng->json() : [];
5454
} catch (\Exception $e) {
5555
$ingredientes = [];

Frontend/app/Services/Inventario/CategoriaIngredientesService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class CategoriaIngredientesService
1111
public function __construct()
1212
{
1313
// Obtiene la URL base de la API desde el archivo .env
14-
$this->baseUrl = env('API_BASE_URL', 'http://44.195.189.38');
14+
$this->baseUrl = env('API_BASE_URL', 'http://32.193.167.191:8080');
1515
}
1616

1717
/**

Frontend/app/Services/Inventario/IngredientesService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class IngredientesService
1212
public function __construct()
1313
{
1414
// Prioriza la URL del .env, usa localhost:8080 como respaldo
15-
$this->baseUrl = env('API_BASE_URL', 'http://localhost:8080');
15+
$this->baseUrl = env('API_BASE_URL', 'http://32.193.167.191:8080');
1616
}
1717

1818
/**

Frontend/app/Services/Inventario/InventarioService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class InventarioService
1111
public function __construct()
1212
{
1313
// Obtiene la URL base de tu microservicio desde el archivo .env de Laravel
14-
$this->baseUrl = env('API_SPRING_URL');
14+
$this->baseUrl = env('API_BASE_URL', 'http://32.193.167.191:8080');
1515
}
1616

1717
// ===========================================

Frontend/app/Services/Inventario/PedidosProveedoresService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class PedidosProveedoresService
1111

1212
public function __construct()
1313
{
14-
$this->baseUrl = env('API_BASE_URL', 'http://localhost:8080');
14+
$this->baseUrl = env('API_BASE_URL', 'http://32.193.167.191:8080');
1515
}
1616

1717
protected function getApiClient()

Frontend/app/Services/Inventario/ProduccionService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ProduccionService
1212
public function __construct()
1313
{
1414
// Obtiene la URL base de la API desde el archivo .env
15-
$this->baseUrl = env('API_BASE_URL', 'http://44.195.189.38:8080');
15+
$this->baseUrl = env('API_BASE_URL', 'http://32.193.167.191:8080');
1616
}
1717

1818
protected function getApiClient()

Frontend/app/Services/Inventario/ProveedoresService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ProveedoresService
1212
public function __construct()
1313
{
1414
// Obtiene la URL base de la API desde el archivo .env
15-
$this->baseUrl = env('API_BASE_URL', 'http://44.195.189.38:8080');
15+
$this->baseUrl = env('API_BASE_URL', 'http://32.193.167.191:8080');
1616
}
1717

1818
/**

Frontend/app/Services/Inventario/RecetasService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class RecetasService
1212

1313
public function __construct()
1414
{
15-
$this->baseUrl = env('API_BASE_URL', 'http://44.195.189.38:8080');
15+
$this->baseUrl = env('API_BASE_URL', 'http://32.193.167.191:8080');
1616
}
1717

1818
protected function getApiClient()

0 commit comments

Comments
 (0)