How to use the openneuro-client.datasets.updatePublic 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 / utils / datalad.js View on Github external
updatePublic(datasetId, publicFlag) {
      console.log('calling updatePublic mutation with id:', datasetId, 'and publicFlag:', publicFlag)
      const mutation = datasets.updatePublic
      return new Promise((resolve, reject) => {
        client.mutate({
          mutation: mutation,
          variables: {
            id: bids.decodeId(datasetId),
            publicFlag: publicFlag
          }
        })
        .then(data => {
          console.log('response from updatePublic:', data)
          resolve(data)
        })
        .catch(err => {
          console.log(err)
          reject(err)
        })