fix(journals): add type='button' to prevent form submission and migrate to V3 Action API for file downloads
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user