export type DeleteApiV1CollectionsCollectionIdItemsCollectionItemIdArgs = {collection_id: number, collection_item_id: number}; export type DeleteApiV1CollectionsCollectionIdItemsCollectionItemIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * コレクションからアイテムを削除 * * DELETE /v1/collections/{collection_id}/items/{collection_item_id} */ export const deleteApiV1CollectionsCollectionIdItemsCollectionItemId = async (args: DeleteApiV1CollectionsCollectionIdItemsCollectionItemIdArgs, options?: DeleteApiV1CollectionsCollectionIdItemsCollectionItemIdOptions) => { 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))}/items/${encodeURIComponent(String(args.collection_item_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 };