DocDoeAI / src /lib /api /support.ts
asnannp's picture
deploy: sync backend to Space root (learn-lesson HF cache fix)
65d68f5
Raw History Blame Contribute Delete
808 Bytes
import { apiPost } from "@/lib/api/client";
/**
* Bug reports and product feedback. The backend accepts these with or without
* a signed-in user (beta students may report before logging in); apiPost adds
* the auth token automatically when a session exists.
*/
export type SupportKind = "bug" | "feedback";
export type SupportSubmissionInput = {
kind: SupportKind;
message: string;
category?: string | null;
title?: string | null;
rating?: number | null;
page_url?: string | null;
};
export type SupportSubmissionResult = {
id: string;
kind: string;
status: string;
created_at: string;
};
export function submitSupport(
input: SupportSubmissionInput,
): Promise<SupportSubmissionResult> {
return apiPost<SupportSubmissionResult, SupportSubmissionInput>("/support", input);
}