@@ -41,6 +41,10 @@ const indexProject = Promise.coroutine(function* (logger, msg) { // eslint-disab
4141 // removes non required fields from phase objects
4242 data . phases = data . phases . map ( phase => _ . omit ( phase , [ 'deletedAt' , 'deletedBy' ] ) ) ;
4343 }
44+ // TEMPORARY FIX: should fix ES mapping instead and reindex all the projects instead
45+ if ( typeof _ . get ( data , 'details.taasDefinition.team.skills' ) !== 'string' ) {
46+ _ . set ( data , 'details.taasDefinition.team.skills' , '' ) ;
47+ }
4448 // add the record to the index
4549 const result = yield eClient . index ( {
4650 index : ES_PROJECT_INDEX ,
@@ -91,6 +95,10 @@ const projectUpdatedHandler = Promise.coroutine(function* (logger, msg, channel)
9195 // first get the existing document and than merge the updated changes and save the new document
9296 const doc = yield eClient . get ( { index : ES_PROJECT_INDEX , type : ES_PROJECT_TYPE , id : data . original . id } ) ;
9397 const merged = _ . merge ( doc . _source , data . updated ) ; // eslint-disable-line no-underscore-dangle
98+ // TEMPORARY FIX: should fix ES mapping instead and reindex all the projects instead
99+ if ( typeof _ . get ( merged , 'details.taasDefinition.team.skills' ) !== 'string' ) {
100+ _ . set ( merged , 'details.taasDefinition.team.skills' , '' ) ;
101+ }
94102 // update the merged document
95103 yield eClient . update ( {
96104 index : ES_PROJECT_INDEX ,
@@ -173,6 +181,10 @@ async function projectUpdatedKafkaHandler(app, topic, payload) {
173181 try {
174182 const doc = await eClient . get ( { index : ES_PROJECT_INDEX , type : ES_PROJECT_TYPE , id : previousValue . id } ) ;
175183 const merged = _ . merge ( doc . _source , project . get ( { plain : true } ) ) ; // eslint-disable-line no-underscore-dangle
184+ // TEMPORARY FIX: should fix ES mapping instead and reindex all the projects instead
185+ if ( typeof _ . get ( merged , 'details.taasDefinition.team.skills' ) !== 'string' ) {
186+ _ . set ( merged , 'details.taasDefinition.team.skills' , '' ) ;
187+ }
176188 // update the merged document
177189 await eClient . update ( {
178190 index : ES_PROJECT_INDEX ,
0 commit comments