More code clean up

This commit is contained in:
Scott Idem
2024-05-23 19:45:17 -04:00
parent 0005ba7dc9
commit d9ff625db6
3 changed files with 136 additions and 104 deletions

View File

@@ -25,8 +25,8 @@ export let get_object = async function get_object(
auto_download=false,
as_list=false,
// The task_id value should be a random string that is unique to the task. This is used to identify the task in the message event.
task_id='get_object_x',
log_lvl=0
task_id=crypto.randomUUID(),
log_lvl=1
} : {
api_cfg: any,
endpoint: string,
@@ -44,7 +44,7 @@ export let get_object = async function get_object(
}
) {
if (log_lvl) {
console.log(`*** get_object() *** Endpoint: ${endpoint} Task ID: ${task_id}`);
console.log(`*** get_object() *** Endpoint: ${endpoint} AE Task ID: ${task_id}`);
console.log('Params:', params);
if (log_lvl > 1) {
console.log('Data:', data);
@@ -110,21 +110,6 @@ export let get_object = async function get_object(
}
if (!return_blob) {
// let response_data_promise = await axios_api.get(
// endpoint,
// {
// params: params,
// 'paramsSerializer': params => parse_params(params),
// onDownloadProgress: (progressEvent) => {
// let percent_completed = Math.round(
// (progressEvent.loaded * 100) / progressEvent.total
// );
// console.log('GET Data Timestamp:', progressEvent.timeStamp, 'Total:', progressEvent.total, 'Loaded:', progressEvent.loaded, 'Percent Completed', percent_completed);
// temp_get_object_percent_completed = percent_completed;
// }
// }
// )
let response_data_promise = await axios_api.get(
endpoint,
{
@@ -254,7 +239,6 @@ export let get_object = async function get_object(
endpoint,
{
params: params,
// 'paramsSerializer': params => parse_params(params),
responseType: 'blob',
onDownloadProgress: (progressEvent) => {
let percent_completed = Math.round(