export type DefinedCrowdPublicApiApiModelsProjectsUpdateProjectUpdateProjectViewModel = {projectName: string, desiredDeliveryDate: string | null, metatags: {[key: string]: unknown} | null}; export type UpdateApiV20PublicProjectsProjectIdArgs = {projectId: string, body: DefinedCrowdPublicApiApiModelsProjectsUpdateProjectUpdateProjectViewModel}; export type UpdateApiV20PublicProjectsProjectIdOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Edit Project * * PUT /v2.0/public/projects/{projectId} */ export const updateApiV20PublicProjectsProjectId = async (args: UpdateApiV20PublicProjectsProjectIdArgs, options: UpdateApiV20PublicProjectsProjectIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/v2.0/public/projects/${encodeURIComponent(String(args.projectId))}${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 };