mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 09:18:59 +00:00
d747a471af
* Isolate each API entity * Improve code structure in API client and request mocks * Standardize on a request mock structure * Use helper for creating request mocks * Adds Request class to handle API requests
47 lines
1.1 KiB
JavaScript
47 lines
1.1 KiB
JavaScript
import createRequestMock from 'test/mocks/create_request_mock';
|
|
|
|
export default {
|
|
loadAll: {
|
|
valid: (bearerToken, query) => {
|
|
return createRequestMock({
|
|
bearerToken,
|
|
endpoint: '/api/v1/kolide/targets',
|
|
method: 'post',
|
|
params: {
|
|
query,
|
|
selected: {
|
|
hosts: [],
|
|
labels: [],
|
|
},
|
|
},
|
|
response: {
|
|
targets_count: 1234,
|
|
targets: [
|
|
{
|
|
id: 3,
|
|
label: 'OS X El Capitan 10.11',
|
|
name: 'osx-10.11',
|
|
platform: 'darwin',
|
|
target_type: 'hosts',
|
|
},
|
|
{
|
|
id: 4,
|
|
label: 'Jason Meller\'s Macbook Pro',
|
|
name: 'jmeller.local',
|
|
platform: 'darwin',
|
|
target_type: 'hosts',
|
|
},
|
|
{
|
|
id: 4,
|
|
label: 'All Macs',
|
|
name: 'macs',
|
|
count: 1234,
|
|
target_type: 'labels',
|
|
},
|
|
],
|
|
},
|
|
});
|
|
},
|
|
},
|
|
};
|