1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

Fix issue preventing inventory groups from loading

A conditional was in place to check if a URL included the base path,
if so, it was supposed to use the URL as-is, otherwise it should get
the URL by referencing a property in an object containing default
URLs.

The conditional checked only for 'api/v1'. Since we're at v2, the
check failed eventually resulting in a `replace` call on an
undefined value.  I replaced the conditional to pattern match
api/v*/ instead.
This commit is contained in:
gconsidine 2017-04-04 10:29:04 -04:00
parent 83e186cb59
commit fcd899d7bc

View File

@ -10,7 +10,7 @@ export default
this.canAdd = function(apiPath) { this.canAdd = function(apiPath) {
var canAddVal = $q.defer(); var canAddVal = $q.defer();
if (apiPath.indexOf("api/v1") > -1) { if (/api\/v[0-9]+\//.test(apiPath)) {
Rest.setUrl(apiPath); Rest.setUrl(apiPath);
} else { } else {
Rest.setUrl(GetBasePath(apiPath)); Rest.setUrl(GetBasePath(apiPath));