mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 01:15:22 +00:00
e52e0747ad
* Modify targets endpoint to use queryId * Conditionally render query page including queryId * Includes conditionally renders target dropdown Co-authored by: Sarah Gillespie @gillespi314 Test mods co-authored by: Gabriel Hernandez @ghernandez345
48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
import createRequestMock from "test/mocks/create_request_mock";
|
|
|
|
export default {
|
|
loadAll: {
|
|
valid: (bearerToken, query, queryId) => {
|
|
return createRequestMock({
|
|
bearerToken,
|
|
endpoint: "/api/v1/fleet/targets",
|
|
method: "post",
|
|
params: {
|
|
query,
|
|
query_id: queryId,
|
|
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",
|
|
},
|
|
],
|
|
},
|
|
});
|
|
},
|
|
},
|
|
};
|