How to use the @cumulus/cmrjs.reconcileCMRMetadata function in @cumulus/cmrjs

To help you get started, we’ve selected a few @cumulus/cmrjs 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 nasa / cumulus / packages / api / models / granules.js View on Github external
async move(g, destinations, distEndpoint) {
    log.info(`granules.move ${g.granuleId}`);

    const updatedFiles = await moveGranuleFiles(g.files, destinations);

    await cmrjs.reconcileCMRMetadata({
      granuleId: g.granuleId,
      updatedFiles,
      distEndpoint,
      published: g.published
    });

    return this.update(
      { granuleId: g.granuleId },
      {
        files: updatedFiles.map(partial(renameProperty, 'name', 'fileName'))
      }
    );
  }