export type UpdateApiApiV1TestUpdateArgs = {body: {testId: number, title: string, description?: (string | null) | undefined, sectionId?: (number | null) | undefined, new_section?: (string | null) | undefined, projectId: number, squadId?: (number | null) | undefined, new_squad?: (string | null) | undefined, preConditions?: (string | null) | undefined, steps?: (string | null) | undefined, expectedResult?: (string | null) | undefined, priorityId: number, typeId?: (number | null) | undefined, automationStatusId: number, testCoveredById?: (number | null) | undefined, platformId?: (number | null) | undefined, labelIds: Array, jiraTicket?: (string | null) | undefined, defects?: (string | null) | undefined, automationId?: (string | null) | undefined, additionalGroups?: (string | null) | undefined}}; export type UpdateApiApiV1TestUpdateOptions = {baseUrl?: string | undefined, cookieAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a test case * * PUT /api/v1/test/update * * Also accepts auth: bearerAuth */ export const updateApiApiV1TestUpdate = async (args: UpdateApiApiV1TestUpdateArgs, options?: UpdateApiApiV1TestUpdateOptions) => { 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/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 };