export type UpdateApiV1AdminSettingsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * 更新站点配置 * * PUT /v1/admin/settings */ export const updateApiV1AdminSettings = async (options: UpdateApiV1AdminSettingsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v1/admin/settings${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };