From c2f01f8e748aa6318444f0fe59ed0c56eda69544 Mon Sep 17 00:00:00 2001 From: Mirhaj Date: Thu, 27 Jun 2024 15:46:27 -0400 Subject: [PATCH] Temporary fix for DMP --- api/controllers/UploadController.js | 7 +++++-- api/util/helpers.js | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/api/controllers/UploadController.js b/api/controllers/UploadController.js index 6612a19..4f0764c 100644 --- a/api/controllers/UploadController.js +++ b/api/controllers/UploadController.js @@ -170,13 +170,16 @@ exports.grid = [ let formValues = req.body; let material = formValues.material; let application = reverseReadableRecipesLib[formValues.application]; - + if (formValues.application.includes('_') || formValues.application ==='ATAC' || formValues.application === 'PEDPEG') { + application = formValues.application; + } + let cleanedMaterial = material; // clean up from DMP material choices i.e. DNA (DMP Sample ID only) if (material.includes('(')) { cleanedMaterial = 'DNA'; } - + let columnsPromise = cache.get(`${material}-${application}-Columns`, () => services.getColumns(cleanedMaterial, application)); Promise.all([columnsPromise]) .then((results) => { diff --git a/api/util/helpers.js b/api/util/helpers.js index bdd755c..1e9da07 100644 --- a/api/util/helpers.js +++ b/api/util/helpers.js @@ -662,6 +662,10 @@ export function submit(submission, user, transactionId) { return new Promise((resolve, reject) => { let serviceId = submission.formValues.serviceId; let recipe = reverseReadableRecipesLib[submission.formValues.application]; + + if (submission.formValues.application.includes('_') || submission.formValues.application ==='ATAC' || submission.formValues.application === 'PEDPEG') { + recipe = submission.formValues.application; + } let capturePanel = submission.formValues.capturePanel; let sampleType = submission.formValues.material; let seqReadLength = submission.formValues.sequencingReadLength || '';