@@ -41,6 +41,10 @@ const indexProject = Promise.coroutine(function* (logger, msg) { // eslint-disab
41
41
// removes non required fields from phase objects
42
42
data . phases = data . phases . map ( phase => _ . omit ( phase , [ 'deletedAt' , 'deletedBy' ] ) ) ;
43
43
}
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
+ }
44
48
// add the record to the index
45
49
const result = yield eClient . index ( {
46
50
index : ES_PROJECT_INDEX ,
@@ -91,6 +95,10 @@ const projectUpdatedHandler = Promise.coroutine(function* (logger, msg, channel)
91
95
// first get the existing document and than merge the updated changes and save the new document
92
96
const doc = yield eClient . get ( { index : ES_PROJECT_INDEX , type : ES_PROJECT_TYPE , id : data . original . id } ) ;
93
97
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
+ }
94
102
// update the merged document
95
103
yield eClient . update ( {
96
104
index : ES_PROJECT_INDEX ,
@@ -173,6 +181,10 @@ async function projectUpdatedKafkaHandler(app, topic, payload) {
173
181
try {
174
182
const doc = await eClient . get ( { index : ES_PROJECT_INDEX , type : ES_PROJECT_TYPE , id : previousValue . id } ) ;
175
183
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
+ }
176
188
// update the merged document
177
189
await eClient . update ( {
178
190
index : ES_PROJECT_INDEX ,
0 commit comments