@openfn/language-dhis2 3.0.2 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/Adaptor.js +5 -4
- package/package.json +1 -1
package/README.md
CHANGED
package/lib/Adaptor.js
CHANGED
|
@@ -322,13 +322,14 @@ function create(resourceType, data, options = {}, callback = false) {
|
|
|
322
322
|
data: (0, _Utils.nestArray)(data, resourceType),
|
|
323
323
|
...requestConfig
|
|
324
324
|
}).then(result => {
|
|
325
|
-
const {
|
|
326
|
-
data
|
|
327
|
-
} = result;
|
|
328
|
-
const details = `with response ${JSON.stringify(data, null, 2)}`;
|
|
325
|
+
const details = `with response ${JSON.stringify(result.data, null, 2)}`;
|
|
329
326
|
|
|
330
327
|
_Utils.Log.success(`Created ${resourceType} ${details}`);
|
|
331
328
|
|
|
329
|
+
const {
|
|
330
|
+
location
|
|
331
|
+
} = result.headers;
|
|
332
|
+
if (location) console.log(`Record available @ ${location}`);
|
|
332
333
|
return (0, _Utils.handleResponse)(result, state, callback);
|
|
333
334
|
});
|
|
334
335
|
};
|