export type UpdateApiV3AdminIssuesIdMoveArgs = {id: string, body: {status?: ('new' | 'todo' | 'in_progress' | 'testing' | 'done') | undefined, before_id?: (number | null) | undefined, index?: number | undefined}}; export type UpdateApiV3AdminIssuesIdMoveOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Drag a card: to a column, right above `before_id` (or at `index`, 0 = top; at the bottom without either) * * PUT /v3/admin/issues/{id}/move */ export const updateApiV3AdminIssuesIdMove = async (args: UpdateApiV3AdminIssuesIdMoveArgs, options?: UpdateApiV3AdminIssuesIdMoveOptions) => { const {baseUrl = "https://api.rhinoartisan.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKeyAuth !== undefined) headers.set("apikey", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v3/admin/issues/${encodeURIComponent(String(args.id))}/move${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };