How to use the openneuro-client.files.sortFiles function in openneuro-client

To help you get started, we’ve selected a few openneuro-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OpenNeuroOrg / openneuro / packages / openneuro-app / src / scripts / uploader / upload-mutation.js View on Github external
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',
  })
}
github OpenNeuroOrg / openneuro / packages / openneuro-cli / src / upload.js View on Github external
.then(tree => {
      tree = generateChanges(tree)
      tree.files = files.sortFiles(tree.files)
      return uploadTree(client, datasetId)(tree)
    })
    .then(() => datasetId)