OpenFn / unicef-cambodia

UNICEF Cambodia - Primero Interoperability
https://openfn.github.io/unicef-cambodia/
1 stars 2 forks source link

If no "non-referral" cases, do not send PUT request to OSCaR #67

Closed aleksa-krolls closed 3 years ago

aleksa-krolls commented 3 years ago

Issue

Currently if there are no nonReferral cases, it looks like we still send a PUT request to the OSCaR system but with an empty data: [] object in the payload. See run failure L290 here: https://www.openfn.org/projects/1671/runs/10649129

https://github.com/OpenFn/unicef-cambodia/blob/f1e4232bb3a1a23dc918c5a6836f8e4b6ad2da58/jobs/f1-j2-casesToOscar.js#L257-L273

state

Oscar creds: Oscar Production Demo See sample state with NO nonreferral cases (therefore only a POST request should be sent): NoNonreferrals.json

expression

f1-j2-casesToOscar.js

adaptor

language-http

output

Re-run this job and we should see green checks: https://www.openfn.org/projects/1671/jobs/2435

aleksa-krolls commented 3 years ago

@taylordowns2000 let's walk through this after the training tomorrow AM