Fix vote export to CSV/TSV & export currency custom field.

This commit is contained in:
Bryan Mutai 2020-05-26 22:56:47 +03:00
parent 18eafe2fec
commit 8c149da9e9
3 changed files with 40 additions and 24 deletions

View file

@ -107,6 +107,13 @@ export class CsvCreator {
options: headerRow[i].split('-')[3].split('/'),
position: i,
});
} else if (headerRow[i].split('-')[2] === 'currency') {
index.customFields.push({
name: headerRow[i].split('-')[1],
type: headerRow[i].split('-')[2],
currencyCode: headerRow[i].split('-')[3],
position: i,
});
} else {
index.customFields.push({
name: headerRow[i].split('-')[1],
@ -127,6 +134,10 @@ export class CsvCreator {
return { _id: Random.id(6), name: option };
}),
};
} else if (customField.type === 'currency') {
settings = {
currencyCode: customField.currencyCode,
};
} else {
settings = {};
}