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