Skip to content

Commit

Permalink
update API factroy constanst and spec file
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob McGuinness committed Feb 23, 2016
1 parent f993c56 commit 3034c0d
Show file tree
Hide file tree
Showing 2 changed files with 312 additions and 273 deletions.
27 changes: 19 additions & 8 deletions lib/core/api/api-factory.js
Expand Up @@ -20,14 +20,8 @@
CUSTOMER_ID: 'X-Availity-Customer-ID',
RESPONSE_ENCODING: 'X-Response-Encoding-Context'
}
}
});

// Factory that creates ApiResourcess
var ApiResourcesProvider = function() {

// Provider default options that can be overridden at config time
var defaultOptions = {
},
OPTIONS: {
// pre-prend the url with a value like `/public` so we can build urls like `public/api/v1/*`
prefix: '',
// default base url for endpoints
Expand Down Expand Up @@ -59,6 +53,22 @@
// Turn off content encoding for angular apis
'X-Response-Encoding-Context': 'NONE'
}
}
});

// Factory that creates ApiResourcess
var ApiResourcesProvider = function(AV_API) {

// Provider default options that can be overridden at config time
var defaultOptions = _.merge({}, AV_API.OPTIONS);

// Allow overrides in config phase
this.setOptions = function(options) {
_.merge(defaultOptions, options);
};

this.getOptions = function() {
return angular.copy(defaultOptions);
};

/**
Expand Down Expand Up @@ -327,4 +337,5 @@
};

availity.core.provider('AvApiResource', ApiResourcesProvider);

})(window);

0 comments on commit 3034c0d

Please sign in to comment.