mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-17 03:08:36 -05:00
Merge remote-tracking branch 'tower/release_3.2.2' into devel
This commit is contained in:
@@ -62,13 +62,20 @@ function requestWithCache (config) {
|
||||
* @yields {boolean} - Indicating a match has been found. If so, the results
|
||||
* are set on the model.
|
||||
*/
|
||||
function search (params, config) {
|
||||
function search (params = {}, config = {}) {
|
||||
const req = {
|
||||
method: 'GET',
|
||||
url: this.path,
|
||||
params
|
||||
url: this.path
|
||||
};
|
||||
|
||||
if (typeof params === 'string') {
|
||||
req.url = `?params`;
|
||||
} else if (Array.isArray(params)) {
|
||||
req.url += `?${params.join('&')}`;
|
||||
} else {
|
||||
req.params = params;
|
||||
}
|
||||
|
||||
return $http(req)
|
||||
.then(({ data }) => {
|
||||
if (!data.count) {
|
||||
|
||||
Reference in New Issue
Block a user