Skip to content

Commit

Permalink
fix(api-axios): replace axios merge with deep-assign
Browse files Browse the repository at this point in the history
axios merge does not do deep merges and does not work with arrays (at any level)
This fixes pollng as the pollingIntervals array was previouslly being transformed into a object and now it will remain an array.
  • Loading branch information
TheSharpieOne committed Aug 6, 2018
1 parent 5c7516b commit a7183b1
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 38 deletions.
3 changes: 3 additions & 0 deletions packages/api-axios/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"main": "src/index.js",
"author": "Kasey Powers <kasey.powers@availity.com>",
"license": "MIT",
"dependencies": {
"deep-assign": "^2.0.0"
},
"peerDependencies": {
"@availity/api-core": "^2.0.1",
"axios": "^0.16.0 || ^0.17.0"
Expand Down
4 changes: 1 addition & 3 deletions packages/api-axios/src/api.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import axios from 'axios';
import utils from 'axios/lib/utils';
import merge from 'deep-assign';
import Api from '@availity/api-core';

const { merge } = utils;

export default class AvApi extends Api {
constructor(options) {
super({
Expand Down
4 changes: 1 addition & 3 deletions packages/api-axios/src/files.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import axios from 'axios';
import utils from 'axios/lib/utils';
import merge from 'deep-assign';
import { AvFiles } from '@availity/api-core';

const { merge } = utils;

export default new AvFiles({
http: axios,
promise: Promise,
Expand Down
4 changes: 1 addition & 3 deletions packages/api-axios/src/logs.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import axios from 'axios';
import utils from 'axios/lib/utils';
import merge from 'deep-assign';
import { AvLogMessages } from '@availity/api-core';

const { merge } = utils;

export default new AvLogMessages({
http: axios,
promise: Promise,
Expand Down
4 changes: 1 addition & 3 deletions packages/api-axios/src/ms.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import axios from 'axios';
import utils from 'axios/lib/utils';
import merge from 'deep-assign';
import { AvMicroservice } from '@availity/api-core';

const { merge } = utils;

export default class AvMicroserviceApi extends AvMicroservice {
constructor(options) {
super({
Expand Down
3 changes: 1 addition & 2 deletions packages/api-axios/src/navigation.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import axios from 'axios';
import utils from 'axios/lib/utils';
import merge from 'deep-assign';
import { AvNavigation } from '@availity/api-core';

const { merge } = utils;
export default new AvNavigation({
http: axios,
promise: Promise,
Expand Down
4 changes: 1 addition & 3 deletions packages/api-axios/src/notification.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import axios from 'axios';
import utils from 'axios/lib/utils';
import merge from 'deep-assign';
import { AvNotification } from '@availity/api-core';

const { merge } = utils;

class AvNotificationApi extends AvNotification {
constructor(options) {
super({
Expand Down
3 changes: 1 addition & 2 deletions packages/api-axios/src/organizations.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import axios from 'axios';
import utils from 'axios/lib/utils';
import merge from 'deep-assign';
import { AvOrganizations } from '@availity/api-core';
import avUserApi from './user';

const { merge } = utils;
export default new AvOrganizations({
http: axios,
promise: Promise,
Expand Down
3 changes: 1 addition & 2 deletions packages/api-axios/src/pdf.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import axios from 'axios';
import utils from 'axios/lib/utils';
import merge from 'deep-assign';
import { AvPdf } from '@availity/api-core';

const { merge } = utils;
export default new AvPdf({
http: axios,
promise: Promise,
Expand Down
3 changes: 1 addition & 2 deletions packages/api-axios/src/permissions.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import axios from 'axios';
import utils from 'axios/lib/utils';
import merge from 'deep-assign';
import { AvPermissions } from '@availity/api-core';

const { merge } = utils;
export default new AvPermissions({
http: axios,
promise: Promise,
Expand Down
3 changes: 1 addition & 2 deletions packages/api-axios/src/providers.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import axios from 'axios';
import utils from 'axios/lib/utils';
import merge from 'deep-assign';
import { AvProviders } from '@availity/api-core';

const { merge } = utils;
export default new AvProviders({
http: axios,
promise: Promise,
Expand Down
3 changes: 1 addition & 2 deletions packages/api-axios/src/proxy.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import axios from 'axios';
import utils from 'axios/lib/utils';
import merge from 'deep-assign';
import { AvProxy } from '@availity/api-core';

const { merge } = utils;
export default class AvProxyApi extends AvProxy {
constructor(options) {
super({
Expand Down
3 changes: 1 addition & 2 deletions packages/api-axios/src/regions.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import axios from 'axios';
import utils from 'axios/lib/utils';
import merge from 'deep-assign';
import { AvRegions } from '@availity/api-core';
import userApi from './user';

const { merge } = utils;
export default new AvRegions({
http: axios,
promise: Promise,
Expand Down
4 changes: 1 addition & 3 deletions packages/api-axios/src/settings.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import axios from 'axios';
import utils from 'axios/lib/utils';
import merge from 'deep-assign';
import { AvSettings } from '@availity/api-core';

const { merge } = utils;

export default new AvSettings({
http: axios,
promise: Promise,
Expand Down
3 changes: 1 addition & 2 deletions packages/api-axios/src/spaces.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import axios from 'axios';
import utils from 'axios/lib/utils';
import merge from 'deep-assign';
import { AvSpaces } from '@availity/api-core';

const { merge } = utils;
export default new AvSpaces({
http: axios,
promise: Promise,
Expand Down
3 changes: 1 addition & 2 deletions packages/api-axios/src/user.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import axios from 'axios';
import utils from 'axios/lib/utils';
import merge from 'deep-assign';
import { AvUsers } from '@availity/api-core';

const { merge } = utils;
export default new AvUsers({
http: axios,
promise: Promise,
Expand Down
3 changes: 1 addition & 2 deletions packages/api-axios/src/userPermissions.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import axios from 'axios';
import utils from 'axios/lib/utils';
import merge from 'deep-assign';
import { AvUserPermissions } from '@availity/api-core';

const { merge } = utils;
export default new AvUserPermissions({
http: axios,
promise: Promise,
Expand Down

0 comments on commit a7183b1

Please sign in to comment.