style: cleanup to excel import

This commit is contained in:
Carlos Valente
2025-06-28 08:11:40 +02:00
committed by Carlos Valente
parent 310dde4465
commit b66eac3c9f
2 changed files with 4 additions and 3 deletions
@@ -50,13 +50,13 @@ export function generateRundownPreview(options: ImportMap): { rundown: Rundown;
const parsedCustomFields = parseCustomFields(dataFromExcel);
// we run the parsed data through an extra step to ensure the objects shape
const Rundown = parseRundown(dataFromExcel.rundown, parsedCustomFields);
if (Rundown.order.length === 0) {
const rundown = parseRundown(dataFromExcel.rundown, parsedCustomFields);
if (rundown.order.length === 0) {
throw new Error(`Could not find data to import in the worksheet: ${options.worksheet}`);
}
// clear the data
excelData = xlsx.utils.book_new();
return { rundown: Rundown, customFields: parsedCustomFields };
return { rundown, customFields: parsedCustomFields };
}