fix(mobile): повторный enroll и удаление устройств в UI (0.9.10).
При повторной привязке Seaca переиспользуется запись device_uuid вместо INSERT.
Добавлены POST /devices/{id}/revoke и DELETE для полного удаления записи в настройках SAC.
This commit is contained in:
+6
-2
@@ -1,4 +1,4 @@
|
||||
const TOKEN_KEY = "sac_token";
|
||||
const TOKEN_KEY = "sac_token";
|
||||
const ROLE_KEY = "sac_role";
|
||||
|
||||
export function getToken(): string | null {
|
||||
@@ -373,7 +373,11 @@ export function fetchMobileDevices(): Promise<MobileDevice[]> {
|
||||
}
|
||||
|
||||
export function revokeMobileDevice(deviceId: number): Promise<MobileDevice> {
|
||||
return apiFetch<MobileDevice>(`/api/v1/mobile/devices/${deviceId}`, { method: "DELETE" });
|
||||
return apiFetch<MobileDevice>(`/api/v1/mobile/devices/${deviceId}/revoke`, { method: "POST" });
|
||||
}
|
||||
|
||||
export function deleteMobileDevice(deviceId: number): Promise<void> {
|
||||
return apiFetch<void>(`/api/v1/mobile/devices/${deviceId}`, { method: "DELETE" });
|
||||
}
|
||||
|
||||
export function testMobileDevicePush(deviceId: number): Promise<{ message: string }> {
|
||||
|
||||
Reference in New Issue
Block a user