export type CreateApiV1ChannelReportReportIdCompletedArgs = {reportId: string}; export type CreateApiV1ChannelReportReportIdCompletedOptions = {baseUrl?: string | undefined, ChannelAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Mark Report completed * * POST /v1/channel/report/{reportId}/completed */ export const createApiV1ChannelReportReportIdCompleted = async (args: CreateApiV1ChannelReportReportIdCompletedArgs, options?: CreateApiV1ChannelReportReportIdCompletedOptions) => { const {baseUrl = "https://scx-sbx.api.jtl-software.com", fetch: fetchFn = fetch, ChannelAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ChannelAuth !== undefined) headers.set('authorization', `Bearer ${ChannelAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/channel/report/${encodeURIComponent(String(args.reportId))}/completed${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };