|
|
@ -103,9 +103,19 @@ router.get('/', async function(req, res, next) { |
|
|
|
|
|
|
|
router.post('/', async function(req, res, next) { |
|
|
|
// const url = 'https://bodacc-datadila.opendatasoft.com/api/explore/v2.1/catalog/datasets/annonces-commerciales/exports/csv?lang=fr&refine=publicationavis%3A%22A%22&refine=publicationavis_facette%3A%22Bodacc%20A%22&refine=familleavis_lib%3A%22Ventes%20et%20cessions%22&timezone=Asia%2FBaghdad&use_labels=true&delimiter=%3B';
|
|
|
|
const url = 'https://bodacc-datadila.opendatasoft.com/api/explore/v2.1/catalog/datasets/annonces-commerciales/exports/csv?lang=fr&refine=publicationavis%3A%22A%22&refine=publicationavis_facette%3A%22Bodacc%20A%22&refine=familleavis_lib%3A%22Ventes%20et%20cessions%22&refine=numerodepartement%3A%2275%22&refine=typeavis_lib%3A%22Avis%20d%E2%80%99annulation%22&timezone=Asia%2FBaghdad&use_labels=true&delimiter=%3B'; |
|
|
|
|
|
|
|
const columns = ['id', 'region_code', 'region_nom_officiel', 'listepersonnes.personne.typePersonne', 'listepersonnes.personne.denomination', 'listepersonnes.personne.numeroImmatriculation.numeroIdentification', 'parutionavisprecedent.nomPublication', 'parutionavisprecedent.dateParution', 'dateparution']; |
|
|
|
// get url from form
|
|
|
|
// get columns from form
|
|
|
|
const url = req.body.url || ''; |
|
|
|
const columns = req.body.columns || []; |
|
|
|
|
|
|
|
if ( !url ) { |
|
|
|
return res.status(500).send('Invalid url'); |
|
|
|
} |
|
|
|
if ( !columns ) { |
|
|
|
return res.status(500).send('Invalid columns'); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const fileService = new FileService(); |
|
|
|
|
|
|
|