export type DeleteApiUserDictWordWordUuidArgs = {word_uuid: string}; export type DeleteApiUserDictWordWordUuidOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * ユーザー辞書に登録されている単語を削除する * * DELETE /user_dict_word/{word_uuid} */ export const deleteApiUserDictWordWordUuid = async (args: DeleteApiUserDictWordWordUuidArgs, options: DeleteApiUserDictWordWordUuidOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/user_dict_word/${encodeURIComponent(String(args.word_uuid))}${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 };