export type UpdateApiApiV1TestBulkUpdateArgs = {body: {testIds: Array, projectId: number, priorityId?: (number | null) | undefined, squadId?: (number | null) | undefined, automationStatusId?: (number | null) | undefined, labelIds?: (Array | null) | undefined}}; export type UpdateApiApiV1TestBulkUpdateOptions = {baseUrl?: string | undefined, cookieAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Bulk update tests * * PUT /api/v1/test/bulk-update * * Also accepts auth: bearerAuth */ export const updateApiApiV1TestBulkUpdate = async (args: UpdateApiApiV1TestBulkUpdateArgs, options?: UpdateApiApiV1TestBulkUpdateOptions) => { const {baseUrl = "http://localhost:3000", fetch: fetchFn = fetch, cookieAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (cookieAuth !== undefined) cookies.push("user_session=" + encodeURIComponent(cookieAuth)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/test/bulk-update${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 };