From 281972cb5dd1dd462fe8dc5ef34bb3ebd514271b Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Tue, 3 Feb 2026 22:14:22 -0500 Subject: [PATCH] fix(journals): add type='button' to prevent form submission and migrate to V3 Action API for file downloads --- ..._comp__hosted_files_download_button.svelte | 2 +- src/lib/api/api.ts | 4 +-- .../(launcher)/launcher_file_cont.svelte | 2 +- .../events/ae_comp__event_file_obj_tbl.svelte | 6 ++-- .../(idaa)/archives/[archive_id]/+page.svelte | 1 - .../ae_idaa_comp__media_player.svelte | 16 +++++----- src/routes/journals/+layout.svelte | 11 +++---- src/routes/journals/+page.svelte | 12 +++---- .../journals/[journal_id]/+layout.svelte | 9 ++---- .../ae_comp__journal_entry_editor.svelte | 10 +++--- .../ae_comp__journal_entry_header.svelte | 12 +++---- .../ae_comp__journal_entry_obj_file_li.svelte | 5 ++- .../ae_comp__journal_entry_obj_id_view.svelte | 2 +- .../ae_comp__journal_entry_obj_li.svelte | 24 +++++--------- .../ae_comp__journal_entry_obj_qry.svelte | 3 +- .../ae_comp__journal_entry_quick_add.svelte | 2 ++ .../ae_comp__journal_obj_id_edit.svelte | 30 ++++++++--------- .../ae_comp__journal_obj_id_view.svelte | 3 +- .../ae_comp__modal_journal_config.svelte | 7 ++-- ...ae_comp__modal_journal_entry_append.svelte | 6 ++-- ...ae_comp__modal_journal_entry_config.svelte | 32 +++++++++---------- .../ae_comp__modal_journal_export.svelte | 9 +++--- .../ae_comp__modal_journal_import.svelte | 4 +-- .../journals/ae_comp__obj_core_props.svelte | 24 +++++--------- 24 files changed, 104 insertions(+), 132 deletions(-) diff --git a/src/lib/ae_core/ae_comp__hosted_files_download_button.svelte b/src/lib/ae_core/ae_comp__hosted_files_download_button.svelte index 935a2b31..2cf64539 100644 --- a/src/lib/ae_core/ae_comp__hosted_files_download_button.svelte +++ b/src/lib/ae_core/ae_comp__hosted_files_download_button.svelte @@ -168,7 +168,7 @@ // Legacy endpoints often expect integer IDs and will return 404 for string IDs. const file_id = hosted_file_obj.event_file_id || hosted_file_obj.hosted_file_id || hosted_file_id; const obj_type_path = hosted_file_obj.event_file_id ? 'event_file' : 'hosted_file'; - return `${$ae_api.base_url}/v3/action/${obj_type_path}/${file_id}/download?filename=${ae_util.clean_filename(final_filename)}&x_no_account_id_token=${$ae_api.account_id}`; + return `${$ae_api.base_url}/v3/action/${obj_type_path}/${file_id}/download?filename=${ae_util.clean_filename(final_filename)}&key=${$ae_api.account_id}`; }); async function handle_click() { diff --git a/src/lib/api/api.ts b/src/lib/api/api.ts index 35387be2..9bf1634d 100644 --- a/src/lib/api/api.ts +++ b/src/lib/api/api.ts @@ -644,7 +644,7 @@ export const download_hosted_file = async function download_hosted_file({ const task_id = hosted_file_id; - const endpoint = `/hosted_file/${hosted_file_id}/download`; + const endpoint = `/v3/action/hosted_file/${hosted_file_id}/download`; if (filename) { params['filename'] = filename; } @@ -697,7 +697,7 @@ export const delete_hosted_file = async function delete_hosted_file({ }) { console.log('*** stores_hosted_api.js: delete_hosted_file() ***'); - const endpoint = `/hosted_file/${hosted_file_id}`; + const endpoint = `/v3/action/hosted_file/${hosted_file_id}`; if (link_to_type) { params['link_to_type'] = link_to_type; } diff --git a/src/routes/events/[event_id]/(launcher)/launcher_file_cont.svelte b/src/routes/events/[event_id]/(launcher)/launcher_file_cont.svelte index ec8e8fc6..1dd37775 100644 --- a/src/routes/events/[event_id]/(launcher)/launcher_file_cont.svelte +++ b/src/routes/events/[event_id]/(launcher)/launcher_file_cont.svelte @@ -105,7 +105,7 @@ open_file_status_message = 'Downloading file to cache...'; // Use the PROVEN endpoint path from api.ts that is known to work in Default Mode. - const url = `${$ae_api.base_url}/v3/action/hosted_file/${event_file_obj.hosted_file_id}/download?return_file=true&filename=${encodeURIComponent(event_file_obj.filename)}&x_no_account_id_token=direct-download`; + const url = `${$ae_api.base_url}/v3/action/hosted_file/${event_file_obj.hosted_file_id}/download?return_file=true&filename=${encodeURIComponent(event_file_obj.filename)}&key=${$ae_api.account_id}`; const dl_result = await native.download_to_cache({ url, diff --git a/src/routes/events/ae_comp__event_file_obj_tbl.svelte b/src/routes/events/ae_comp__event_file_obj_tbl.svelte index 92c14ff9..5dd13277 100644 --- a/src/routes/events/ae_comp__event_file_obj_tbl.svelte +++ b/src/routes/events/ae_comp__event_file_obj_tbl.svelte @@ -394,7 +394,7 @@ @@ -431,11 +431,11 @@ > Session Name: diff --git a/src/routes/idaa/(idaa)/archives/[archive_id]/+page.svelte b/src/routes/idaa/(idaa)/archives/[archive_id]/+page.svelte index 18b746d9..053e1f12 100644 --- a/src/routes/idaa/(idaa)/archives/[archive_id]/+page.svelte +++ b/src/routes/idaa/(idaa)/archives/[archive_id]/+page.svelte @@ -44,7 +44,6 @@ import Archive_content_obj_li from './ae_idaa_comp__archive_content_obj_li.svelte'; import Archive_content_obj_id_edit from './ae_idaa_comp__archive_content_obj_id_edit.svelte'; - // import Media_player from './../ae_idaa_comp__media_player.svelte'; import Modal_media_player from './ae_idaa_comp__modal_media_player.svelte'; import Help_tech from '$lib/app_components/e_app_help_tech.svelte'; diff --git a/src/routes/idaa/(idaa)/archives/ae_idaa_comp__media_player.svelte b/src/routes/idaa/(idaa)/archives/ae_idaa_comp__media_player.svelte index de069090..4dd7e4b9 100644 --- a/src/routes/idaa/(idaa)/archives/ae_idaa_comp__media_player.svelte +++ b/src/routes/idaa/(idaa)/archives/ae_idaa_comp__media_player.svelte @@ -91,8 +91,8 @@ About --> - - - {/if} diff --git a/src/routes/journals/ae_comp__journal_entry_obj_file_li.svelte b/src/routes/journals/ae_comp__journal_entry_obj_file_li.svelte index 5d8e5727..3e780538 100644 --- a/src/routes/journals/ae_comp__journal_entry_obj_file_li.svelte +++ b/src/routes/journals/ae_comp__journal_entry_obj_file_li.svelte @@ -173,8 +173,7 @@ {#if $ae_loc.edit_mode} - diff --git a/src/routes/journals/ae_comp__journal_entry_obj_li.svelte b/src/routes/journals/ae_comp__journal_entry_obj_li.svelte index aff033ab..39e47a53 100644 --- a/src/routes/journals/ae_comp__journal_entry_obj_li.svelte +++ b/src/routes/journals/ae_comp__journal_entry_obj_li.svelte @@ -193,8 +193,7 @@ {#if !journals_journal_entry_obj.private} - - - - - - - - - @@ -201,13 +201,13 @@ {#if tab === 'actions'}
- - -
@@ -252,12 +252,12 @@
-
{/each} -
- + {tmp__journal_obj.sort ?? 0} - +
@@ -339,7 +339,7 @@
-
@@ -505,10 +505,10 @@ {#snippet footer()}
- -
diff --git a/src/routes/journals/ae_comp__journal_obj_id_view.svelte b/src/routes/journals/ae_comp__journal_obj_id_view.svelte index 1cc246f8..378f40f2 100644 --- a/src/routes/journals/ae_comp__journal_obj_id_view.svelte +++ b/src/routes/journals/ae_comp__journal_obj_id_view.svelte @@ -180,8 +180,7 @@
- -
diff --git a/src/routes/journals/ae_comp__modal_journal_entry_append.svelte b/src/routes/journals/ae_comp__modal_journal_entry_append.svelte index 38b62874..704950a3 100644 --- a/src/routes/journals/ae_comp__modal_journal_entry_append.svelte +++ b/src/routes/journals/ae_comp__modal_journal_entry_append.svelte @@ -172,8 +172,7 @@ async function handle_save() { @@ -138,16 +138,16 @@ {#if tab === 'actions'}
- - - -
@@ -156,7 +156,7 @@

Quick Category

{#each journal?.cfg_json?.category_li ?? [] as cat} - + {tmp_entry_obj.sort ?? 0} - +
@@ -238,9 +238,9 @@ Manual list position
- + {tmp_entry_obj.sort ?? 0} - +
@@ -267,7 +267,7 @@ Disaster Recovery

If the encryption passcode is lost, the data is unrecoverable. You can force a reset to plain text to reuse this entry ID.

- @@ -275,7 +275,7 @@ {/if}
-
@@ -294,7 +294,7 @@ {#snippet footer()} - diff --git a/src/routes/journals/ae_comp__modal_journal_export.svelte b/src/routes/journals/ae_comp__modal_journal_export.svelte index ef077a8a..ce3a0810 100644 --- a/src/routes/journals/ae_comp__modal_journal_export.svelte +++ b/src/routes/journals/ae_comp__modal_journal_export.svelte @@ -111,7 +111,8 @@
{#each templates as template} - +
- -
diff --git a/src/routes/journals/ae_comp__modal_journal_import.svelte b/src/routes/journals/ae_comp__modal_journal_import.svelte index 287d3674..cfb2a026 100644 --- a/src/routes/journals/ae_comp__modal_journal_import.svelte +++ b/src/routes/journals/ae_comp__modal_journal_import.svelte @@ -232,8 +232,8 @@ {/if}