diff --git a/src/app/api/_lib/helpers/extraFieldHelpers.js b/src/app/api/_lib/helpers/extraFieldHelpers.js index 2ed276e..f5fed97 100644 --- a/src/app/api/_lib/helpers/extraFieldHelpers.js +++ b/src/app/api/_lib/helpers/extraFieldHelpers.js @@ -32,9 +32,8 @@ export const edit = async (field) => { try { let extraField = await ExtraField.findById(field._id) const { name, type, description, required, showCard, hiddenDownload, category, selectablesOptions } = field - if (selectablesOptions) { - if (selectablesOptions instanceof File) { + if (selectablesOptions.type === "text/csv") { await uploadFileS3(field.selectablesOptions) extraField.selectablesOptions = selectablesOptions.name } else { @@ -56,7 +55,7 @@ export const edit = async (field) => { export const save = async (field) => { try { - if (field.selectablesOptions && field.selectablesOptions instanceof File) { + if (field.selectablesOptions && field.selectablesOptions.type === "text/csv") { await uploadFileS3(field.selectablesOptions) field.selectablesOptions = field.selectablesOptions.name }