From 1934ad887511337362aae66c5994f830d92b69a3 Mon Sep 17 00:00:00 2001 From: Oliver Stolpe Date: Wed, 10 May 2023 14:00:02 +0200 Subject: [PATCH] fix: vuejs case disease terms not editable (#948) --- cases/vueapp/src/components/CaseDetailCardTerms.vue | 5 ++++- cases/vueapp/src/stores/case-details.js | 11 +++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cases/vueapp/src/components/CaseDetailCardTerms.vue b/cases/vueapp/src/components/CaseDetailCardTerms.vue index 00038db9a..eaeb5cf4f 100644 --- a/cases/vueapp/src/components/CaseDetailCardTerms.vue +++ b/cases/vueapp/src/components/CaseDetailCardTerms.vue @@ -142,7 +142,10 @@ const userHasPerms = (perm) =>
diff --git a/cases/vueapp/src/stores/case-details.js b/cases/vueapp/src/stores/case-details.js index fa45da471..5f6f784af 100644 --- a/cases/vueapp/src/stores/case-details.js +++ b/cases/vueapp/src/stores/case-details.js @@ -241,7 +241,7 @@ export const useCaseDetailsStore = defineStore( /** Get case phenotypes from store. */ const getCasePhenotypeTerms = (casePhenotypeTermsUuid) => { - for (const phenotypeTerms of caseObj.value.phenotype_terms) { + for (const phenotypeTerms of casePhenotypeTerms.value) { if (phenotypeTerms.sodar_uuid === casePhenotypeTermsUuid) { return phenotypeTerms } @@ -262,12 +262,11 @@ export const useCaseDetailsStore = defineStore( casePhenotypeTermsUuid, payload ) - for (let i = 0; i < caseObj.value.phenotype_terms.length; ++i) { + for (let i = 0; i < casePhenotypeTerms.value.length; ++i) { if ( - caseObj.value.phenotype_terms[i].sodar_uuid === - casePhenotypeTermsUuid + casePhenotypeTerms.value[i].sodar_uuid === casePhenotypeTermsUuid ) { - caseObj.value.phenotype_terms[i] = apiCasePhenotypeTerms + casePhenotypeTerms.value[i] = apiCasePhenotypeTerms break } } @@ -287,7 +286,7 @@ export const useCaseDetailsStore = defineStore( caseUuid, payload ) - caseObj.value.phenotype_terms.push(apiCasePhenotypeTerms) + casePhenotypeTerms.value.push(apiCasePhenotypeTerms) } finally { casesStore.serverInteractions -= 1 }