feat: add public report PDF preview endpoint and update report content handling for Typst-based resumes

This commit is contained in:
Anish Sarkar 2026-04-16 22:51:36 +05:30
parent 6037058a09
commit e2cd0557a5
6 changed files with 65 additions and 9 deletions

View file

@ -182,9 +182,10 @@ function ResumeCard({
const [thumbState, setThumbState] = useState<"loading" | "ready" | "error">("loading");
useEffect(() => {
setPdfUrl(
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/reports/${reportId}/preview`
);
const previewPath = shareToken
? `/api/v1/public/${shareToken}/reports/${reportId}/preview`
: `/api/v1/reports/${reportId}/preview`;
setPdfUrl(`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}${previewPath}`);
if (autoOpen && isDesktop && !autoOpenedRef.current) {
autoOpenedRef.current = true;