From 41a8b32aff99345f7a6754efec45d1d8ae1932f9 Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Thu, 19 Mar 2026 15:28:16 +0100 Subject: [PATCH] feat: Add API route to export modified gammes data to an Excel file. --- src/app/api/export/modified-gammes/route.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/api/export/modified-gammes/route.ts b/src/app/api/export/modified-gammes/route.ts index 5178b45..0b838b2 100644 --- a/src/app/api/export/modified-gammes/route.ts +++ b/src/app/api/export/modified-gammes/route.ts @@ -38,7 +38,7 @@ export async function POST(req: NextRequest) { sheet.columns = [ { header: "CODE FOURNISSEUR", key: "codeFournisseur", width: 22 }, - { header: "GENCOD", key: "gtin", width: 18 }, + { header: "CODEIN", key: "codein", width: 18 }, { header: "GAMME", key: "gamme", width: 12 }, ]; @@ -49,7 +49,7 @@ export async function POST(req: NextRequest) { for (const row of changes) { sheet.addRow({ codeFournisseur: row.codeFournisseur || "—", - gtin: row.gtin || "—", + codein: row.codein || "—", gamme: row.gamme || "—", }); } @@ -58,9 +58,9 @@ export async function POST(req: NextRequest) { const gammeCol = sheet.getColumn("gamme"); gammeCol.alignment = { horizontal: "center" }; - // Format codein et gtin en texte pour eviter la notation scientifique excel + // Format en texte pour eviter la notation scientifique excel sheet.getColumn("codeFournisseur").numFmt = "@"; - sheet.getColumn("gtin").numFmt = "@"; + sheet.getColumn("codein").numFmt = "@"; // Generate buffer const buffer = await workbook.xlsx.writeBuffer();