fix: correct convert_file API path from /v3/action/hosted_file to /hosted_file

The endpoint is registered under the older hosted_file router at /hosted_file/{id}/convert_file,
not under the v3 actions router. Both list and table convert buttons were sending to the wrong path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-03-11 14:12:53 -04:00
parent 477fc16f16
commit 8cba7899db
2 changed files with 4 additions and 8 deletions

View File

@@ -80,7 +80,7 @@
// WHY: Poster sessions display files in the Launcher modal via <img> tag — PDFs can't render there. // WHY: Poster sessions display files in the Launcher modal via <img> tag — PDFs can't render there.
// Presenters upload PDFs which must be converted server-side to high-res webp images. // Presenters upload PDFs which must be converted server-side to high-res webp images.
// Button is only shown in edit_mode for PDF files linked to a poster-type session. // Button is only shown in edit_mode for PDF files linked to a poster-type session.
// Backend: /v3/action/hosted_file/{id}/convert_file runs pdf2image (3840px wide, first page only) // Backend: /hosted_file/{id}/convert_file runs pdf2image (3840px wide, first page only)
// and saves the result as a new hosted_file record linked to the same parent object. // and saves the result as a new hosted_file record linked to the same parent object.
type ConvertStatus = 'idle' | 'converting' | 'done' | 'error'; type ConvertStatus = 'idle' | 'converting' | 'done' | 'error';
let convert_status_kv: Record<string, ConvertStatus> = $state({}); let convert_status_kv: Record<string, ConvertStatus> = $state({});
@@ -98,7 +98,7 @@
|| event_file_obj.event_presentation_id || event_file_obj.event_presentation_id
|| event_file_obj.event_id; || event_file_obj.event_id;
const filename_no_ext = (event_file_obj.filename ?? 'poster_image').replace(/\.pdf$/i, ''); const filename_no_ext = (event_file_obj.filename ?? 'poster_image').replace(/\.pdf$/i, '');
const url = `${$ae_api.base_url}/v3/action/hosted_file/${event_file_obj.hosted_file_id}/convert_file` const url = `${$ae_api.base_url}/hosted_file/${event_file_obj.hosted_file_id}/convert_file`
+ `?link_to_type=${encodeURIComponent(link_to_type_val)}` + `?link_to_type=${encodeURIComponent(link_to_type_val)}`
+ `&link_to_id=${encodeURIComponent(link_to_id_val)}` + `&link_to_id=${encodeURIComponent(link_to_id_val)}`
+ `&filename_no_ext=${encodeURIComponent(filename_no_ext)}` + `&filename_no_ext=${encodeURIComponent(filename_no_ext)}`
@@ -281,10 +281,6 @@
</button> </button>
{/if} {/if}
</div> </div>
{:else}
<!-- this is showing -->
test test test
<!-- this is showing -->
{/if} {/if}
{#if ae_tmp.show__direct_download} {#if ae_tmp.show__direct_download}

View File

@@ -69,7 +69,7 @@
// WHY: Poster sessions display files in the Launcher modal via <img> tag — PDFs can't render there. // WHY: Poster sessions display files in the Launcher modal via <img> tag — PDFs can't render there.
// Presenters upload PDFs which must be converted server-side to high-res webp images. // Presenters upload PDFs which must be converted server-side to high-res webp images.
// Button is only shown in edit_mode for PDF files linked to a poster-type session. // Button is only shown in edit_mode for PDF files linked to a poster-type session.
// Backend: /v3/action/hosted_file/{id}/convert_file runs pdf2image (3840px wide, first page only) // Backend: /hosted_file/{id}/convert_file runs pdf2image (3840px wide, first page only)
// and saves the result as a new hosted_file record linked to the same parent object. // and saves the result as a new hosted_file record linked to the same parent object.
type ConvertStatus = 'idle' | 'converting' | 'done' | 'error'; type ConvertStatus = 'idle' | 'converting' | 'done' | 'error';
let convert_status_kv: Record<string, ConvertStatus> = $state({}); let convert_status_kv: Record<string, ConvertStatus> = $state({});
@@ -87,7 +87,7 @@
|| event_file_obj.event_presentation_id || event_file_obj.event_presentation_id
|| event_file_obj.event_id; || event_file_obj.event_id;
const filename_no_ext = (event_file_obj.filename ?? 'poster_image').replace(/\.pdf$/i, ''); const filename_no_ext = (event_file_obj.filename ?? 'poster_image').replace(/\.pdf$/i, '');
const url = `${$ae_api.base_url}/v3/action/hosted_file/${event_file_obj.hosted_file_id}/convert_file` const url = `${$ae_api.base_url}/hosted_file/${event_file_obj.hosted_file_id}/convert_file`
+ `?link_to_type=${encodeURIComponent(link_to_type)}` + `?link_to_type=${encodeURIComponent(link_to_type)}`
+ `&link_to_id=${encodeURIComponent(link_to_id)}` + `&link_to_id=${encodeURIComponent(link_to_id)}`
+ `&filename_no_ext=${encodeURIComponent(filename_no_ext)}` + `&filename_no_ext=${encodeURIComponent(filename_no_ext)}`