export type DeleteApiTeachingGhostObjectsArgs = {prim_path?: (string | null) | undefined}; export type DeleteApiTeachingGhostObjectsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Clear Ghost Objects * * DELETE /teaching/ghost-objects */ export const deleteApiTeachingGhostObjects = async (args: DeleteApiTeachingGhostObjectsArgs, options: DeleteApiTeachingGhostObjectsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.prim_path != null) query.append("prim_path", String(args.prim_path)) const url = `${baseUrl.replace(/\/+$/, '')}/teaching/ghost-objects${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };