Fixes #3 Push empty line if no CSV question to export for a brand

(cherry picked from commit bf5477d15c56e33fe980dc67cbc10a0b18f58169)
This commit is contained in:
Jérémy Munsch 2023-06-28 16:11:44 +02:00
parent cb65aba6c9
commit ebe8d8daa3
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC

View file

@ -248,6 +248,13 @@ class QuestionController extends Controller
$w->insertOne([]);
}
// * Push empty line if nothing to export
if (empty($results)) {
$w->insertOne([
'Aucune question pour cette marque'
]);
}
/*
We create a callable to output the CSV in chunk
with Symfony StreamResponse you can flush the body content if necessary