export type DeleteApiRestaurantTimingsRestaurantTimingIdArgs = {restaurantId?: number | undefined, restaurantTimingId: number}; export type DeleteApiRestaurantTimingsRestaurantTimingIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete restaurant timing * * DELETE /restaurant_timings/{restaurantTimingId} */ export const deleteApiRestaurantTimingsRestaurantTimingId = async (args: DeleteApiRestaurantTimingsRestaurantTimingIdArgs, options: DeleteApiRestaurantTimingsRestaurantTimingIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.restaurantId != null) query.append("restaurantId", String(args.restaurantId)) const url = `${baseUrl.replace(/\/+$/, '')}/restaurant_timings/${encodeURIComponent(String(args.restaurantTimingId))}${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 };