@@ -20,6 +20,7 @@ async function processCreate (message, transactionId) {
20
20
// Find related resourceBooking
21
21
const resourceBooking = await esClient . getExtra ( {
22
22
index : config . get ( 'esConfig.ES_INDEX_RESOURCE_BOOKING' ) ,
23
+ transactionId,
23
24
id : workPeriod . resourceBookingId
24
25
} )
25
26
console . log ( `[RB value-999] before update: ${ JSON . stringify ( resourceBooking ) } ` )
@@ -76,6 +77,7 @@ async function processUpdate (message, transactionId) {
76
77
// find workPeriod in it's parent ResourceBooking
77
78
let resourceBooking = await esClient . search ( {
78
79
index : config . get ( 'esConfig.ES_INDEX_RESOURCE_BOOKING' ) ,
80
+ transactionId,
79
81
body : {
80
82
query : {
81
83
nested : {
@@ -106,11 +108,12 @@ async function processUpdate (message, transactionId) {
106
108
body : {
107
109
doc : { workPeriods }
108
110
} ,
109
- refresh : constants . esRefreshOption
111
+ refresh : 'true'
110
112
} )
111
113
// find workPeriod's new parent ResourceBooking
112
114
resourceBooking = await esClient . getExtra ( {
113
115
index : config . get ( 'esConfig.ES_INDEX_RESOURCE_BOOKING' ) ,
116
+ transactionId,
114
117
id : data . resourceBookingId
115
118
} )
116
119
// Get ResourceBooking's existing workPeriods
@@ -127,7 +130,7 @@ async function processUpdate (message, transactionId) {
127
130
body : {
128
131
doc : { workPeriods }
129
132
} ,
130
- refresh : constants . esRefreshOption
133
+ refresh : 'true'
131
134
} )
132
135
return
133
136
}
@@ -162,6 +165,7 @@ async function processDelete (message, transactionId) {
162
165
// Find related ResourceBooking
163
166
const resourceBooking = await esClient . search ( {
164
167
index : config . get ( 'esConfig.ES_INDEX_RESOURCE_BOOKING' ) ,
168
+ transactionId,
165
169
body : {
166
170
query : {
167
171
nested : {
0 commit comments