You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
? (r.progres_interoperabiltyreferralrejectionreasonname || "Rejected in proGres (no reason provided)")
140
+
? `${r.progres_interoperabiltyreferralrejectionreasonname || "Rejected in proGres (no reason provided)"} — ${r.progres_interoperabilityreferralrejectionomment || "No comment provided"}`
145
141
: null
146
142
}
147
143
@@ -213,9 +209,9 @@ workflows:
213
209
214
210
return updateReferral(
215
211
{
216
-
caseExternalId: 'case_id', // was: externalId
217
-
caseId: case_id, // was: id (and was being set to the case_id)
218
-
id: referral.id, // was: referral_id
212
+
caseExternalId: 'case_id',
213
+
caseId: case_id,
214
+
id: referral.id,
219
215
data: decision,
220
216
},
221
217
state => {
@@ -230,7 +226,6 @@ workflows:
230
226
return state;
231
227
});
232
228
}));
233
-
234
229
Save-Status-in-Progres:
235
230
name: Save Status in Progres
236
231
adaptor: '@openfn/language-ping@1.0.2'
@@ -265,22 +260,32 @@ workflows:
265
260
return state;
266
261
});
267
262
268
-
http.post('/api/ingestion/v2/PNR-1363/data', state => ({
269
-
"ShippingProcessId": "SHP-2284",
270
-
"InteropId": "INT-1436",
271
-
"Data": state.pingStatusPayloads
272
-
})).then(state => {
273
-
console.log(`Status updated to Synced with PRIMERO for ${state.pingStatusPayloads.length} referral(s)`);
274
-
return state;
275
-
}).catch(error => {
276
-
console.log(`Failed to update PING status. Error: ${error.message}`);
277
-
throw error;
263
+
fn(state => {
264
+
if (state.pingStatusPayloads.length === 0) {
265
+
console.log('No referrals to mark as synced in PING. Skipping.');
266
+
return state;
267
+
}
268
+
269
+
return http.post('/api/ingestion/v2/PNR-1363/data', state => ({
270
+
"ShippingProcessId": "SHP-2284",
271
+
"InteropId": "INT-1436",
272
+
"Data": state.pingStatusPayloads
273
+
}))(state)
274
+
.then(state => {
275
+
console.log(`Status updated to Synced with PRIMERO for ${state.pingStatusPayloads.length} referral(s)`);
276
+
return state;
277
+
})
278
+
.catch(error => {
279
+
console.log(`Failed to update PING status. Error: ${error.message}`);
0 commit comments