Skip to content

Commit

Permalink
Merge pull request #23 from OpenFn/staging
Browse files Browse the repository at this point in the history
Cleaning up final state
  • Loading branch information
daissatou2 authored Aug 24, 2023
2 parents 6d27ebb + 0175eea commit 04a7731
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions jobs/upsertCasesToONA.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,15 @@ fn((state) => {

upsertMany("services", "unique_id", (state) => state.allServices);

// What is happening here ?
// fn((state) => {
// return { ...state };
// });
// 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
fn(state => {
const { client, metadataForAgeRequest, metadataForTypeofCaseRequest } = state;

return {
client,
metadataForAgeRequest,
metadataForTypeofCaseRequest,
};
});

0 comments on commit 04a7731

Please sign in to comment.