export type UpdateApiStudentTicketsTicketIdRepliesReplyIdFeedbackArgs = {ticketId: number, replyId: number, positive: boolean}; export type UpdateApiStudentTicketsTicketIdRepliesReplyIdFeedbackOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Give feedback on the bot reply | Fornisci feedback sulla risposta del bot * * PUT /student/tickets/{ticketId}/replies/{replyId}/feedback */ export const updateApiStudentTicketsTicketIdRepliesReplyIdFeedback = async (args: UpdateApiStudentTicketsTicketIdRepliesReplyIdFeedbackArgs, options?: UpdateApiStudentTicketsTicketIdRepliesReplyIdFeedbackOptions) => { const {baseUrl = "https://app.didattica.polito.it/api", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.positive != null) query.append("positive", String(args.positive)) if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/student/tickets/${encodeURIComponent(String(args.ticketId))}/replies/${encodeURIComponent(String(args.replyId))}/feedback${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };