export type CreateApiV1TechniqueGuidesTechniqueGuideIdLikesArgs = {technique_guide_id: number}; export type CreateApiV1TechniqueGuidesTechniqueGuideIdLikesOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Like technique guide * * POST /v1/technique_guides/{technique_guide_id}/likes */ export const createApiV1TechniqueGuidesTechniqueGuideIdLikes = async (args: CreateApiV1TechniqueGuidesTechniqueGuideIdLikesArgs, options?: CreateApiV1TechniqueGuidesTechniqueGuideIdLikesOptions) => { 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/technique_guides/${encodeURIComponent(String(args.technique_guide_id))}/likes${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };