mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
Check for null resource and update e2e model usage
This commit is contained in:
@@ -447,13 +447,17 @@ function parseRequestConfig (method, resource, config) {
|
|||||||
if (Array.isArray(method)) {
|
if (Array.isArray(method)) {
|
||||||
if (Array.isArray(resource)) {
|
if (Array.isArray(resource)) {
|
||||||
req.resource = resource;
|
req.resource = resource;
|
||||||
|
} else if (resource === null) {
|
||||||
|
req.resource = undefined;
|
||||||
} else if (typeof resource === 'object') {
|
} else if (typeof resource === 'object') {
|
||||||
req = resource;
|
req = resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
req.method = method;
|
req.method = method;
|
||||||
} else if (typeof method === 'string') {
|
} else if (typeof method === 'string') {
|
||||||
if (typeof resource === 'object') {
|
if (resource === null) {
|
||||||
|
req.resource = undefined;
|
||||||
|
} else if (typeof resource === 'object') {
|
||||||
req = resource;
|
req = resource;
|
||||||
} else {
|
} else {
|
||||||
req.resource = resource;
|
req.resource = resource;
|
||||||
@@ -465,7 +469,7 @@ function parseRequestConfig (method, resource, config) {
|
|||||||
} else {
|
} else {
|
||||||
req = config;
|
req = config;
|
||||||
req.method = method;
|
req.method = method;
|
||||||
req.resource = resource;
|
req.resource = resource === null ? undefined : resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
return req;
|
return req;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ module.exports = {
|
|||||||
|
|
||||||
client.inject(
|
client.inject(
|
||||||
[store, 'OrganizationModel'],
|
[store, 'OrganizationModel'],
|
||||||
(_store_, Model) => new Model().http.post(_store_.organization),
|
(_store_, Model) => new Model().http.post({ data: _store_.organization }),
|
||||||
({ data }) => { store.organization = data; }
|
({ data }) => { store.organization = data; }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ module.exports = {
|
|||||||
|
|
||||||
client.inject(
|
client.inject(
|
||||||
[store.credentialType, 'CredentialTypeModel'],
|
[store.credentialType, 'CredentialTypeModel'],
|
||||||
(data, Model) => new Model().http.post(data),
|
(data, Model) => new Model().http.post({ data }),
|
||||||
({ data }) => { store.credentialType.response = data; }
|
({ data }) => { store.credentialType.response = data; }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ module.exports = {
|
|||||||
|
|
||||||
client.inject(
|
client.inject(
|
||||||
[store, 'OrganizationModel'],
|
[store, 'OrganizationModel'],
|
||||||
(_store_, Model) => new Model().http.post(_store_.organization),
|
(_store_, Model) => new Model().http.post({ data: _store_.organization }),
|
||||||
({ data }) => { store.organization = data; }
|
({ data }) => { store.organization = data; }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ module.exports = {
|
|||||||
|
|
||||||
client.inject(
|
client.inject(
|
||||||
[store, 'OrganizationModel'],
|
[store, 'OrganizationModel'],
|
||||||
(_store_, Model) => new Model().http.post(_store_.organization),
|
(_store_, Model) => new Model().http.post({ data: _store_.organization }),
|
||||||
({ data }) => { store.organization = data; }
|
({ data }) => { store.organization = data; }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ module.exports = {
|
|||||||
|
|
||||||
client.inject(
|
client.inject(
|
||||||
[store, 'OrganizationModel'],
|
[store, 'OrganizationModel'],
|
||||||
(_store_, Model) => new Model().http.post(_store_.organization),
|
(_store_, Model) => new Model().http.post({ data: _store_.organization }),
|
||||||
({ data }) => { store.organization = data; }
|
({ data }) => { store.organization = data; }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ module.exports = {
|
|||||||
|
|
||||||
client.inject(
|
client.inject(
|
||||||
[store, 'OrganizationModel'],
|
[store, 'OrganizationModel'],
|
||||||
(_store_, Model) => new Model().http.post(_store_.organization),
|
(_store_, Model) => new Model().http.post({ data: _store_.organization }),
|
||||||
({ data }) => { store.organization = data; }
|
({ data }) => { store.organization = data; }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ module.exports = {
|
|||||||
|
|
||||||
client.inject(
|
client.inject(
|
||||||
[store, 'OrganizationModel'],
|
[store, 'OrganizationModel'],
|
||||||
(_store_, Model) => new Model().http.post(_store_.organization),
|
(_store_, Model) => new Model().http.post({ data: _store_.organization }),
|
||||||
({ data }) => { store.organization = data; }
|
({ data }) => { store.organization = data; }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ module.exports = {
|
|||||||
|
|
||||||
client.inject(
|
client.inject(
|
||||||
[store, 'OrganizationModel'],
|
[store, 'OrganizationModel'],
|
||||||
(_store_, Model) => new Model().http.post(_store_.organization),
|
(_store_, Model) => new Model().http.post({ data: _store_.organization }),
|
||||||
({ data }) => { store.organization = data; }
|
({ data }) => { store.organization = data; }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user