Skip to content

Commit

Permalink
solución a validación csv
Browse files Browse the repository at this point in the history
  • Loading branch information
mpvaldez committed Oct 22, 2024
1 parent cafe692 commit ce97085
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/app/api/_lib/helpers/extraFieldHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}
Expand Down

0 comments on commit ce97085

Please sign in to comment.