export type UpdateApiAppProjectsProjectManagerArgs = {project: number, body: {manager_user_id?: (number | null) | undefined}}; export type UpdateApiAppProjectsProjectManagerOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Set the project manager * * PUT /app/projects/{project}/manager */ export const updateApiAppProjectsProjectManager = async (args: UpdateApiAppProjectsProjectManagerArgs, options: UpdateApiAppProjectsProjectManagerOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/app/projects/${encodeURIComponent(String(args.project))}/manager${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 };