Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
id: createResponse.id,
resource: file,
name: file.name,
authentication: authentication,
params: {}
};
// Check for folder in resource filename
const filenameParts = file.name.split("/");
if (filenameParts.length > 1) {
addResourceOptions.name = filenameParts[1];
addResourceOptions.params = {
resourcesPrefix: filenameParts[0]
};
}
updateDefs.push(portal.addItemResource(addResourceOptions));
});
}
});
}
const addRsrcOptions = {
id: itemId,
resource: blob,
name: filename,
authentication: authentication,
params: {}
};
if (folder) {
addRsrcOptions.params = {
resourcesPrefix: folder
};
}
return portal.addItemResource(addRsrcOptions);
}