mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
use combined endpoint for android (#37562)
fix a bug that the frontend wasn't changed to use the shared mdm unenroll endpoint
This commit is contained in:
parent
7c16c3b9fc
commit
3d14b1c962
3 changed files with 4 additions and 15 deletions
|
|
@ -40,11 +40,7 @@ const UnenrollMdmModal = ({
|
|||
const submitUnenrollMdm = async () => {
|
||||
setRequestState("unenrolling");
|
||||
try {
|
||||
if (isAndroid(hostPlatform)) {
|
||||
await mdmAPI.unenrollAndroidHostFromMdm(hostId, 5000);
|
||||
} else {
|
||||
await mdmAPI.unenrollHostFromMdm(hostId, 5000);
|
||||
}
|
||||
await mdmAPI.unenrollHostFromMdm(hostId, 5000);
|
||||
const successMessage =
|
||||
isIPadOrIPhone(hostPlatform) || isAndroid(hostPlatform) ? (
|
||||
<>
|
||||
|
|
|
|||
|
|
@ -102,20 +102,15 @@ export type IGetBootstrapPackageSummaryResponse = IBootstrapPackageAggregate;
|
|||
|
||||
const mdmService = {
|
||||
unenrollHostFromMdm: (hostId: number, timeout?: number) => {
|
||||
const { HOST_MDM_UNENROLL } = endpoints;
|
||||
const { HOST_MDM } = endpoints;
|
||||
return sendRequest(
|
||||
"PATCH",
|
||||
HOST_MDM_UNENROLL(hostId),
|
||||
"DELETE",
|
||||
HOST_MDM(hostId),
|
||||
undefined,
|
||||
undefined,
|
||||
timeout
|
||||
);
|
||||
},
|
||||
// Android-specific: admin-initiated unenroll uses POST /api/_version_/fleet/hosts/{id}/mdm/unenroll
|
||||
unenrollAndroidHostFromMdm: (hostId: number, timeout?: number) => {
|
||||
const path = `${endpoints.HOST_MDM(hostId)}/unenroll`;
|
||||
return sendRequest("POST", path, undefined, undefined, timeout);
|
||||
},
|
||||
requestCSR: () => {
|
||||
const { MDM_REQUEST_CSR } = endpoints;
|
||||
|
||||
|
|
|
|||
|
|
@ -181,8 +181,6 @@ export default {
|
|||
MDM_EULA_UPLOAD: `/${API_VERSION}/fleet/mdm/setup/eula`,
|
||||
MDM_EULA_METADATA: `/${API_VERSION}/fleet/mdm/setup/eula/metadata`,
|
||||
HOST_MDM: (id: number) => `/${API_VERSION}/fleet/hosts/${id}/mdm`,
|
||||
HOST_MDM_UNENROLL: (id: number) =>
|
||||
`/${API_VERSION}/fleet/mdm/hosts/${id}/unenroll`,
|
||||
HOST_ENCRYPTION_KEY: (id: number) =>
|
||||
`/${API_VERSION}/fleet/hosts/${id}/encryption_key`,
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue