Source: filters/checkToolDeepLink.js

/**
 * Returns the deep link to the check tool for a given dataset and organisation
 *
 * @param {{name:string}} organisation
 * @param {{dataset:string, name:string}} dataset
 *
 * @return {string}
 */
export function checkToolDeepLink (organisation, dataset, uploadMethod) {
  if (!organisation || !dataset) {
    return '/check'
  }
  const url = `/check/link?dataset=${encodeURIComponent(dataset.dataset)}&orgName=${encodeURIComponent(organisation.name)}&orgId=${encodeURIComponent(organisation.organisation)}`
  return uploadMethod ? `${url}&uploadMethod=${encodeURIComponent(uploadMethod)}` : url
}