export type GetApiV1ExercisesExerciseIdLikesArgs = {exercise_id: number}; export type GetApiV1ExercisesExerciseIdLikesOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * List exercise likes * * GET /v1/exercises/{exercise_id}/likes */ export const getApiV1ExercisesExerciseIdLikes = async (args: GetApiV1ExercisesExerciseIdLikesArgs, options?: GetApiV1ExercisesExerciseIdLikesOptions) => { 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: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };