export type DeleteApiApiV1MenusPropertiesPropertyIdMenuItemsItemIdArgs = {property_id: string, item_id: string}; export type DeleteApiApiV1MenusPropertiesPropertyIdMenuItemsItemIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete Menu Item * * DELETE /api/v1/menus/properties/{property_id}/menu-items/{item_id} */ export const deleteApiApiV1MenusPropertiesPropertyIdMenuItemsItemId = async (args: DeleteApiApiV1MenusPropertiesPropertyIdMenuItemsItemIdArgs, options: DeleteApiApiV1MenusPropertiesPropertyIdMenuItemsItemIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/menus/properties/${encodeURIComponent(String(args.property_id))}/menu-items/${encodeURIComponent(String(args.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 };