Skip to content

Commit

Permalink
fix(indicateurs): fix encodage du nom de fichier de la trajectoire
Browse files Browse the repository at this point in the history
  • Loading branch information
dthib committed Aug 22, 2024
1 parent 3e349cf commit f6343e5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions backend/src/indicateurs/service/trajectoires.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { NextFunction, Response } from 'express';
import { JSZipGeneratorOptions } from 'jszip';
import * as _ from 'lodash';
import { DateTime } from 'luxon';
import slugify from 'slugify';
import * as XlsxTemplate from 'xlsx-template';
import { EpciType } from '../../collectivites/models/collectivite.models';
import CollectivitesService from '../../collectivites/services/collectivites.service';
Expand Down Expand Up @@ -137,9 +136,7 @@ export default class TrajectoiresService {
}

getNomFichierTrajectoire(epci: EpciType) {
return slugify(`Trajectoire SNBC - ${epci.siren} - ${epci.nom}`, {
replacement: ' ',
});
return `Trajectoire SNBC - ${epci.siren} - ${epci.nom}`;
}

async downloadModeleTrajectoireSnbc(res: Response, next: NextFunction) {
Expand Down Expand Up @@ -274,7 +271,7 @@ export default class TrajectoiresService {
const generatedData = template.generate(zipOptions as any);

// Set the output file name.
res.attachment(`${nomFichier}.xlsx`);
res.attachment(`${nomFichier}.xlsx`.normalize('NFD'));
res.set('Access-Control-Expose-Headers', 'Content-Disposition');

// Send the workbook.
Expand Down

0 comments on commit f6343e5

Please sign in to comment.