export type DeleteApiV1CollectionsCollectionIdArgs = {collection_id: number}; export type DeleteApiV1CollectionsCollectionIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * コレクションの削除 * * DELETE /v1/collections/{collection_id} */ export const deleteApiV1CollectionsCollectionId = async (args: DeleteApiV1CollectionsCollectionIdArgs, options?: DeleteApiV1CollectionsCollectionIdOptions) => { const {baseUrl = "https://shikorism.net/api", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v1/collections/${encodeURIComponent(String(args.collection_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };