From f918e2c216a905df97f95747eec7dd2027bb1a55 Mon Sep 17 00:00:00 2001 From: daissatou2 <80456839+daissatou2@users.noreply.github.com> Date: Thu, 24 Aug 2023 09:18:58 -0500 Subject: [PATCH 1/2] mtuchi@openfn.org's change on OpenFn.org --- jobs/upsertCasesToONA.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/jobs/upsertCasesToONA.js b/jobs/upsertCasesToONA.js index 8bff873..e5a8352 100644 --- a/jobs/upsertCasesToONA.js +++ b/jobs/upsertCasesToONA.js @@ -298,7 +298,14 @@ fn((state) => { upsertMany("services", "unique_id", (state) => state.allServices); -// What is happening here ? -// fn((state) => { -// return { ...state }; -// }); \ No newline at end of file +// Cleaning up final state that will be passed to request-next-batch +// Notice the client key, it's important to include that key because it's being +// used by the adaptor for hanlding DB connection +const { client, metadataForAgeRequest, metadataForTypeofCaseRequest } = state; + + return { + client, + metadataForAgeRequest, + metadataForTypeofCaseRequest, + }; +}); \ No newline at end of file From 0175eea47465b8aebf9b22844e9b87feb2cb7e6c Mon Sep 17 00:00:00 2001 From: daissatou2 <80456839+daissatou2@users.noreply.github.com> Date: Thu, 24 Aug 2023 09:20:13 -0500 Subject: [PATCH 2/2] mtuchi@openfn.org's change on OpenFn.org --- jobs/upsertCasesToONA.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jobs/upsertCasesToONA.js b/jobs/upsertCasesToONA.js index e5a8352..41ec5fc 100644 --- a/jobs/upsertCasesToONA.js +++ b/jobs/upsertCasesToONA.js @@ -301,7 +301,8 @@ upsertMany("services", "unique_id", (state) => state.allServices); // Cleaning up final state that will be passed to request-next-batch // Notice the client key, it's important to include that key because it's being // used by the adaptor for hanlding DB connection -const { client, metadataForAgeRequest, metadataForTypeofCaseRequest } = state; +fn(state => { + const { client, metadataForAgeRequest, metadataForTypeofCaseRequest } = state; return { client,