diff --git a/frontend/dist/index.html b/frontend/dist/index.html index cbca26d..a7a1f61 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -24,7 +24,7 @@ - + diff --git a/frontend/src/api/candidates.js b/frontend/src/api/candidates.js index 1afa119..b949343 100644 --- a/frontend/src/api/candidates.js +++ b/frontend/src/api/candidates.js @@ -12,7 +12,7 @@ function returns the parsed {data, total, status_code} envelope. ============================================================ */ -import { downloadFile, request } from '../lib/apiClient' +import { downloadFile, fetchBlobUrl, request } from '../lib/apiClient' /** Active job posts for pickers. Needs job_board.view OR candidates.view. * @@ -80,6 +80,18 @@ export function downloadCvBankCv(id) { return downloadFile('/documents/download', { params: { manual_upload_candidate_id: id } }) } +/** + * Object URL of a stored CV for IN-APP preview (no download). The route sends + * octet-stream, so the blob is re-typed to application/pdf for the browser's + * inline viewer. Caller revokes the URL when the preview closes. + */ +export function viewCvBankCv(id) { + return fetchBlobUrl('/documents/download', { + params: { manual_upload_candidate_id: id }, + type: 'application/pdf', + }) +} + /** * Score the decoded attachments of inbox messages against a job post. * Needs candidates.create. messageIds are inbox_messages PK uuids (the `id` diff --git a/frontend/src/lib/apiClient.js b/frontend/src/lib/apiClient.js index 9cf0bea..2935634 100644 --- a/frontend/src/lib/apiClient.js +++ b/frontend/src/lib/apiClient.js @@ -188,12 +188,14 @@ export async function downloadFile(path, { params, auth = true, filename } = {}) } /** - * Authenticated binary GET returning an object URL for /