feat: historial muestra todos los turnos del auto con estado, km y comentario
Deploy / deploy (push) Successful in 3m52s
Deploy / deploy (push) Successful in 3m52s
Reemplaza HistorialServicio por Turno en ambas APIs y frontends (cliente y admin). Muestra: servicio, fecha, horario, estado (badge), km al ingreso, observaciones del jefe. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,11 +14,11 @@ export async function GET(req: NextRequest) {
|
||||
const auto = await prisma.auto.findFirst({ where: { id: autoId, clienteId: sesion.sub } });
|
||||
if (!auto) return NextResponse.json({ error: "Auto no encontrado" }, { status: 404 });
|
||||
|
||||
const historial = await prisma.historialServicio.findMany({
|
||||
const turnos = await prisma.turno.findMany({
|
||||
where: { autoId },
|
||||
include: { admin: { select: { nombre: true } }, tipoServicio: { select: { nombre: true } } },
|
||||
orderBy: { fechaRealizado: "desc" },
|
||||
include: { tipoServicio: { select: { nombre: true } } },
|
||||
orderBy: { fechaInicio: "desc" },
|
||||
});
|
||||
|
||||
return NextResponse.json(historial);
|
||||
return NextResponse.json(turnos);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user