Spaces:
Sleeping
Sleeping
Update routers/clientes.py
Browse files- routers/clientes.py +3 -3
routers/clientes.py
CHANGED
@@ -34,7 +34,7 @@ def get_clientes():
|
|
34 |
|
35 |
|
36 |
# post/clientes -> crear un cliente con with connection as conn, manejo de errores
|
37 |
-
|
38 |
def post_cliente(cliente: Clientes):
|
39 |
try:
|
40 |
with DatabaseConnection().get_connection() as conn:
|
@@ -55,7 +55,7 @@ def post_cliente(cliente: Clientes):
|
|
55 |
|
56 |
|
57 |
# put/clientes -> actualizar un cliente con with connection as conn, manejo de errores
|
58 |
-
|
59 |
def put_cliente(cliente: Clientes):
|
60 |
try:
|
61 |
with DatabaseConnection().get_connection() as conn:
|
@@ -77,7 +77,7 @@ def put_cliente(cliente: Clientes):
|
|
77 |
|
78 |
|
79 |
# delete/clientes -> eliminar un cliente con with connection as conn, manejo de errores
|
80 |
-
|
81 |
def delete_cliente(ID_Proveedor: int):
|
82 |
try:
|
83 |
with DatabaseConnection().get_connection() as conn:
|
|
|
34 |
|
35 |
|
36 |
# post/clientes -> crear un cliente con with connection as conn, manejo de errores
|
37 |
+
@router.post("/")
|
38 |
def post_cliente(cliente: Clientes):
|
39 |
try:
|
40 |
with DatabaseConnection().get_connection() as conn:
|
|
|
55 |
|
56 |
|
57 |
# put/clientes -> actualizar un cliente con with connection as conn, manejo de errores
|
58 |
+
@router.put("/")
|
59 |
def put_cliente(cliente: Clientes):
|
60 |
try:
|
61 |
with DatabaseConnection().get_connection() as conn:
|
|
|
77 |
|
78 |
|
79 |
# delete/clientes -> eliminar un cliente con with connection as conn, manejo de errores
|
80 |
+
@router.delete("/{ID_Proveedor}")
|
81 |
def delete_cliente(ID_Proveedor: int):
|
82 |
try:
|
83 |
with DatabaseConnection().get_connection() as conn:
|