Skip to content

Commit

Permalink
fix: vuejs case disease terms not editable (#948) (#949)
Browse files Browse the repository at this point in the history
  • Loading branch information
stolpeo authored May 10, 2023
1 parent 2dabbef commit c6be021
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
5 changes: 4 additions & 1 deletion cases/vueapp/src/components/CaseDetailCardTerms.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ const userHasPerms = (perm) =>
</template>
<br />
<template v-if="termsMap[member.name]?.terms?.length">
<div v-for="term in termsMap[member.name].terms">
<div
v-for="term in termsMap[member.name].terms"
@change="fetchTermLabels()"
>
{{ term.label || term.term }}
</div>
</template>
Expand Down
11 changes: 5 additions & 6 deletions cases/vueapp/src/stores/case-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
}
Expand All @@ -287,7 +286,7 @@ export const useCaseDetailsStore = defineStore(
caseUuid,
payload
)
caseObj.value.phenotype_terms.push(apiCasePhenotypeTerms)
casePhenotypeTerms.value.push(apiCasePhenotypeTerms)
} finally {
casesStore.serverInteractions -= 1
}
Expand Down

0 comments on commit c6be021

Please sign in to comment.