patch..
This commit is contained in:
@@ -75,6 +75,20 @@ export async function releasePlatformControl(fetchWithFreshAuth: AuthFetch, plat
|
||||
if (!response.ok) throw new Error('platform-release failed')
|
||||
}
|
||||
|
||||
export async function extendPlatformControl(
|
||||
fetchWithFreshAuth: AuthFetch,
|
||||
platformId: string,
|
||||
): Promise<PlatformControlActionResponse> {
|
||||
const response = await fetchWithFreshAuth(`${LMS_API_BASE_URL}/platform-control/platforms/${encodeURIComponent(platformId)}/extend`, {
|
||||
method: 'POST',
|
||||
})
|
||||
const payload = await response.json().catch(() => null) as PlatformControlActionResponse | { message?: string } | null
|
||||
if (!response.ok) {
|
||||
throw new Error(payload && 'message' in payload && payload.message ? payload.message : '제어 시간 연장에 실패했습니다.')
|
||||
}
|
||||
return payload as PlatformControlActionResponse
|
||||
}
|
||||
|
||||
export async function requestOrCancelPlatformControl(
|
||||
fetchWithFreshAuth: AuthFetch,
|
||||
platform: PlatformOption
|
||||
|
||||
Reference in New Issue
Block a user