Skip to content

Commit

Permalink
G4L-230 Obtener listado de asignaciones
Browse files Browse the repository at this point in the history
  • Loading branch information
logos914 committed Nov 20, 2024
1 parent 5cbdb81 commit bc31255
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions routes/asig_operador_vehiculo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flask import Blueprint
from flask import Blueprint, jsonify
from models.usuario import Usuario
from models.vehiculo import Vehiculo
from models.bitacora_asignaciones import BitacoraAsignaciones
Expand Down Expand Up @@ -26,4 +26,11 @@ def asignar(id_vehiculo, id_usuario):
def desasignar(id_asignacion):
bitacora = BitacoraAsignaciones.encontrarPorId(id_asignacion)
BitacoraAsignaciones.agregarFechaHoraDesasignacion(id_asignacion)
return bitacora.serialize(), 201
return bitacora.serialize(), 201


# Obtener todas las asignaciones
@asig_operador_vehiculo.route('/asignaciones', methods=['GET'])
def obtener_asignaciones():
asignaciones = BitacoraAsignaciones.listar_json()
return jsonify(asignaciones)

0 comments on commit bc31255

Please sign in to comment.