Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
fix configMigrationHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
taylordowns2000 committed May 7, 2020
1 parent dab074a commit 635ae90
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
8 changes: 3 additions & 5 deletions lib/Adaptor.js
Expand Up @@ -138,11 +138,9 @@ function configMigrationHelper(state) {
apiUrl = _state$configuration.apiUrl;

if (!hostUrl) {
return _objectSpread({}, state, {
configuration: _objectSpread({}, state.configruation, {
hostUrl: apiUrl
})
});
console.log('DEPRECATION WARNING: Please migrate instance address from `apiUrl` to `hostUrl`.');
state.configuration.hostUrl = apiUrl;
return state;
}

return state;
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "language-dhis2",
"version": "1.1.1",
"version": "1.1.2",
"description": "DHIS2 Language Pack for OpenFn",
"main": "lib/index.js",
"scripts": {
Expand Down
7 changes: 3 additions & 4 deletions src/Adaptor.js
Expand Up @@ -43,10 +43,9 @@ export function execute(...operations) {
function configMigrationHelper(state) {
const { hostUrl, apiUrl } = state.configuration;
if (!hostUrl) {
return {
...state,
configuration: { ...state.configruation, hostUrl: apiUrl },
};
console.log('DEPRECATION WARNING: Please migrate instance address from `apiUrl` to `hostUrl`.')
state.configuration.hostUrl = apiUrl;
return state;
}
return state;
}
Expand Down

0 comments on commit 635ae90

Please sign in to comment.