mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 01:18:42 +00:00
Fleet UI: Replace mock API call with autofill API call (#18705)
This commit is contained in:
parent
b670df9447
commit
b864130fe9
2 changed files with 7 additions and 5 deletions
|
|
@ -1,5 +1,4 @@
|
|||
// import sendRequest from "services";
|
||||
import { sendRequest } from "services/mock_service/service/service";
|
||||
import sendRequest from "services";
|
||||
import endpoints from "utilities/endpoints";
|
||||
|
||||
export type IAutofillPolicy = {
|
||||
|
|
@ -9,8 +8,11 @@ export type IAutofillPolicy = {
|
|||
|
||||
export default {
|
||||
getPolicyInterpretationFromSQL: (sql: string): Promise<IAutofillPolicy> => {
|
||||
const { AUTOFILL_POLICIES } = endpoints;
|
||||
const { AUTOFILL_POLICY } = endpoints;
|
||||
|
||||
return sendRequest("POST", AUTOFILL_POLICIES, sql);
|
||||
// API expects JSON object with key "sql"
|
||||
const data = JSON.stringify({ sql });
|
||||
|
||||
return sendRequest("POST", AUTOFILL_POLICY, data);
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ export default {
|
|||
`/${API_VERSION}/fleet/software/versions/${id}`,
|
||||
|
||||
// AI endpoints
|
||||
AUTOFILL_POLICIES: `/${API_VERSION}/fleet/autofill/policies`,
|
||||
AUTOFILL_POLICY: `/${API_VERSION}/fleet/autofill/policy`,
|
||||
|
||||
SSO: `/v1/fleet/sso`,
|
||||
STATUS_LABEL_COUNTS: `/${API_VERSION}/fleet/host_summary`,
|
||||
|
|
|
|||
Loading…
Reference in a new issue