Skip to content

Commit 1fd4d2a

Browse files
committed
Revert "fix: temporary fix to index TaaS project with skills"
This reverts commit 1c24d2a.
1 parent cfc0aac commit 1fd4d2a

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

src/events/projects/index.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ 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-
}
4844
// add the record to the index
4945
const result = yield eClient.index({
5046
index: ES_PROJECT_INDEX,
@@ -95,10 +91,6 @@ const projectUpdatedHandler = Promise.coroutine(function* (logger, msg, channel)
9591
// first get the existing document and than merge the updated changes and save the new document
9692
const doc = yield eClient.get({ index: ES_PROJECT_INDEX, type: ES_PROJECT_TYPE, id: data.original.id });
9793
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-
}
10294
// update the merged document
10395
yield eClient.update({
10496
index: ES_PROJECT_INDEX,
@@ -181,10 +173,6 @@ async function projectUpdatedKafkaHandler(app, topic, payload) {
181173
try {
182174
const doc = await eClient.get({ index: ES_PROJECT_INDEX, type: ES_PROJECT_TYPE, id: previousValue.id });
183175
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-
}
188176
// update the merged document
189177
await eClient.update({
190178
index: ES_PROJECT_INDEX,

src/routes/admin/project-index-create.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@ module.exports = [
9797
projectResponses.map((p) => {
9898
if (p) {
9999
body.push({ index: { _index: indexName, _type: docType, _id: p.id } });
100-
// TEMPORARY FIX: should fix ES mapping instead and reindex all the projects instead
101-
if (typeof _.get(p, 'details.taasDefinition.team.skills') !== 'string') {
102-
_.set(p, 'details.taasDefinition.team.skills', '');
103-
}
104100
body.push(p);
105101
}
106102
// dummy return

0 commit comments

Comments
 (0)