import { Request, Response } from 'express'; import { AppError } from '../errors/app-error'; import { listerMesEmpruntsEnCours } from '../services/emprunt.service'; export async function getMesEmprunts(req: Request, res: Response): Promise { const user = req.user; if (!user) { throw new AppError(401, 'Authentification requise'); } const emprunts = await listerMesEmpruntsEnCours(user.id); res.json({ data: emprunts }); }