@@ -33,7 +33,7 @@ import { getErrorMessage } from 'app/oncokb-commons/components/alert/ErrorAlertU
3333import { FirebaseDataStore } from 'app/stores/firebase/firebase-data.store' ;
3434import { getTumorNameUuid , getUpdatedReview } from 'app/shared/util/firebase/firebase-review-utils' ;
3535import { SentryError } from 'app/config/sentry-error' ;
36- import { GERMLINE_PATH , GET_ALL_DRUGS_PAGE_SIZE } from 'app/config/constants/constants' ;
36+ import { GERMLINE_PATH , GET_ALL_DRUGS_PAGE_SIZE , NEW_NAME_UUID_VALUE } from 'app/config/constants/constants' ;
3737import _ from 'lodash' ;
3838import { getDriveAnnotations } from 'app/shared/util/core-drive-annotation-submission/core-drive-annotation-submission' ;
3939import { DriveAnnotationApi } from 'app/shared/api/manual/drive-annotation-api' ;
@@ -254,13 +254,13 @@ export class FirebaseGeneService {
254254 updateObject = { ...updateObject , ...deleteArrayReturnVal . updateObject } ;
255255 }
256256 for ( const id of [ ...nestedUuids , uuid ] ) {
257- updateObject = { ...updateObject , ...this . firebaseMetaService . getUpdateObject ( false , hugoSymbol , isGermline , [ id ] ) } ;
257+ updateObject = { ...updateObject , ...this . firebaseMetaService . getUpdateObject ( hugoSymbol , isGermline , { [ id ] : null } ) } ;
258258 }
259259 } else {
260260 updateObject = {
261261 ...updateObject ,
262262 [ `${ getFirebaseGenePath ( isGermline , hugoSymbol ) } /${ pathFromGene } _review` ] : review ,
263- ...this . firebaseMetaService . getUpdateObject ( true , hugoSymbol , isGermline , [ uuid ] ) ,
263+ ...this . firebaseMetaService . getUpdateObject ( hugoSymbol , isGermline , { [ uuid ] : true } ) ,
264264 } ;
265265 }
266266
@@ -312,7 +312,7 @@ export class FirebaseGeneService {
312312 throw new SentryError ( 'Could not resolve hugoSymbol' , { tumorPath } ) ;
313313 }
314314
315- let updateObject = { ...this . firebaseMetaService . getUpdateObject ( true , hugoSymbol , isGermline , [ tumorNameUuid ] ) } ;
315+ let updateObject = { ...this . firebaseMetaService . getUpdateObject ( hugoSymbol , isGermline , { [ tumorNameUuid ] : NEW_NAME_UUID_VALUE } ) } ;
316316 const pushResult = await this . firebaseRepository . push ( tumorPath , newTumor , false ) ;
317317 if ( pushResult !== undefined ) {
318318 updateObject = { ...updateObject , ...pushResult . pushUpdateObject } ;
@@ -397,7 +397,7 @@ export class FirebaseGeneService {
397397
398398 if ( hugoSymbol !== undefined ) {
399399 let updateObject = {
400- ...this . firebaseMetaService . getUpdateObject ( true , hugoSymbol , isGermline , [ newTreatment . name_uuid ] ) ,
400+ ...this . firebaseMetaService . getUpdateObject ( hugoSymbol , isGermline , { [ newTreatment . name_uuid ] : NEW_NAME_UUID_VALUE } ) ,
401401 } ;
402402 const pushResult = await this . firebaseRepository . push ( treatmentPath , newTreatment , false ) ;
403403 if ( pushResult !== undefined ) {
@@ -457,12 +457,12 @@ export class FirebaseGeneService {
457457
458458 if ( hugoSymbol !== undefined ) {
459459 let updateObject = {
460- ...this . firebaseMetaService . getUpdateObject ( true , hugoSymbol , isGermline , [ newMutation . name_uuid ] ) ,
460+ ...this . firebaseMetaService . getUpdateObject ( hugoSymbol , isGermline , { [ newMutation . name_uuid ] : NEW_NAME_UUID_VALUE } ) ,
461461 } ;
462462 if ( mutationEffectDescription ) {
463463 updateObject = {
464464 ...updateObject ,
465- ...this . firebaseMetaService . getUpdateObject ( true , hugoSymbol , isGermline , [ newMutation . mutation_effect . description_uuid ] ) ,
465+ ...this . firebaseMetaService . getUpdateObject ( hugoSymbol , isGermline , { [ newMutation . mutation_effect . description_uuid ] : true } ) ,
466466 } ;
467467 }
468468
@@ -511,7 +511,7 @@ export class FirebaseGeneService {
511511 updateObject [ rctPath ] = newRelevantCancerTypes ;
512512 updateObject [ `${ rctPath } _review` ] = new Review ( this . authStore . fullName , undefined , undefined , undefined , true ) ;
513513 updateObject [ `${ rctPath } _uuid` ] = uuid ;
514- const metaUpdateObject = this . firebaseMetaService . getUpdateObject ( true , hugoSymbol ! , isGermline , [ uuid ] ) ;
514+ const metaUpdateObject = this . firebaseMetaService . getUpdateObject ( hugoSymbol ! , isGermline , { [ uuid ] : true } ) ;
515515 updateObject = { ...updateObject , ...metaUpdateObject } ;
516516 } else {
517517 const rctUpdateObject = await this . firebaseGeneReviewService . updateReviewableContent (
@@ -546,7 +546,7 @@ export class FirebaseGeneService {
546546 ) => {
547547 const genePath = parseFirebaseGenePath ( genomicIndicatorsPath ) ;
548548 const newGenomicIndicator = new GenomicIndicator ( ) ;
549- const uuidsToReview : string [ ] = [ ] ;
549+ const uuidsToReview : { [ key : string ] : string | boolean | null } = { } ;
550550 const mutationList = this . firebaseMutationListStore . data ;
551551 const pathogenicVariants = Object . values ( mutationList ?? { } ) . find ( mut => mut . name === PATHOGENIC_VARIANTS ) ;
552552 let pathogenicVariantsNameUuid = pathogenicVariants ?. name_uuid ;
@@ -568,13 +568,13 @@ export class FirebaseGeneService {
568568 if ( toReview ) {
569569 newGenomicIndicator . name_review = _ . cloneDeep ( newReview ) ;
570570 newGenomicIndicator . name_review . added = true ;
571- uuidsToReview . push ( newGenomicIndicator . name_uuid ) ;
571+ uuidsToReview [ newGenomicIndicator . name_uuid ] = NEW_NAME_UUID_VALUE ;
572572 }
573573 if ( description ) {
574574 newGenomicIndicator . description = description ;
575575 if ( toReview ) {
576576 newGenomicIndicator . description_review = newReview ;
577- uuidsToReview . push ( newGenomicIndicator . description_uuid ) ;
577+ uuidsToReview [ newGenomicIndicator . description_uuid ] = true ;
578578 }
579579 }
580580
@@ -584,7 +584,7 @@ export class FirebaseGeneService {
584584 newGenomicIndicator . allele_state [ asKey ] = alleleState ;
585585 if ( toReview ) {
586586 newGenomicIndicator . allele_state [ `${ asKey } _review` ] = newReview ;
587- uuidsToReview . push ( newGenomicIndicator . allele_state [ `${ asKey } _uuid` ] ) ;
587+ uuidsToReview [ newGenomicIndicator . allele_state [ `${ asKey } _uuid` ] ] = true ;
588588 }
589589 } ) ;
590590 }
@@ -602,7 +602,7 @@ export class FirebaseGeneService {
602602 }
603603
604604 if ( toReview ) {
605- updateObject = { ...updateObject , ...this . firebaseMetaService . getUpdateObject ( true , hugoSymbol , true , uuidsToReview ) } ;
605+ updateObject = { ...updateObject , ...this . firebaseMetaService . getUpdateObject ( hugoSymbol , true , uuidsToReview ) } ;
606606 }
607607
608608 await this . firebaseRepository . update ( '/' , updateObject ) ;
0 commit comments