export type DeleteApiV1ExercisesExerciseIdLikesArgs = {exercise_id: number}; export type DeleteApiV1ExercisesExerciseIdLikesOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Unlike exercise * * DELETE /v1/exercises/{exercise_id}/likes */ export const deleteApiV1ExercisesExerciseIdLikes = async (args: DeleteApiV1ExercisesExerciseIdLikesArgs, options?: DeleteApiV1ExercisesExerciseIdLikesOptions) => { const {baseUrl = "http://localhost:3000", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/exercises/${encodeURIComponent(String(args.exercise_id))}/likes${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 };