Skip to content

Commit

Permalink
fix(indicateurs): suppression des accents et characteres speciaux dan…
Browse files Browse the repository at this point in the history
…s le nom du fichier trajectoire
  • Loading branch information
dthib committed Aug 21, 2024
1 parent 915e288 commit cfb2cc6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/src/indicateurs/service/trajectoires.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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 @@ -136,7 +137,9 @@ export default class TrajectoiresService {
}

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

async downloadModeleTrajectoireSnbc(res: Response, next: NextFunction) {
Expand Down

0 comments on commit cfb2cc6

Please sign in to comment.