Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const updateFiles = client => (datasetId, fileList) => {
const tree = treeFromList(fileList)
// Upload dataset_description.json first
tree.files = files.sortFiles(tree.files)
return client.mutate({
mutation: files.updateFiles,
variables: { datasetId, files: tree },
errorPolicy: 'all',
})
}
.then(tree => {
tree = generateChanges(tree)
tree.files = files.sortFiles(tree.files)
return uploadTree(client, datasetId)(tree)
})
.then(() => datasetId)