Code clean up

This commit is contained in:
Scott Idem
2024-05-23 18:59:50 -04:00
parent 42fef3feb8
commit 0005ba7dc9
3 changed files with 29 additions and 9 deletions

View File

@@ -1,11 +1,11 @@
// Aether API Library (TS)
// This is intended to be used with the Aether API.
// This is intended to be used with the Aether API. The goal is to just import all of the core functions and re-export them as a single module. This is to make it easier to import the functions into other modules.
// This needs to be cleaned up and ideally removed the need for Axios.
import { delete_object } from './api_delete_object';
import { get_object } from './api_get_object';
import { patch_object } from './api_patch_object';
import { post_object } from './api_post_object';
import { delete_object } from './api_delete_object'; // Exported at the end of this file
import { get_object } from './api_get_object'; // Exported at the end of this file
import { patch_object } from './api_patch_object'; // Exported at the end of this file
import { post_object } from './api_post_object'; // Exported at the end of this file
// Updated 2023-12-01
@@ -926,11 +926,11 @@ export let send_email = async function send_email({api_cfg, from_email, from_nam
/* END: Utility: Email Related */
function resolved(result) {
function resolved(result: any) {
console.log('Resolved');
}
function rejected(result) {
function rejected(result: any) {
console.error(result);
}

View File

@@ -1,5 +1,7 @@
import axios from 'axios';
import type { key_val } from '$lib/ae_stores';
export let temp_get_blob_percent_completed = 0;
// export let get_blob_percent_completed = readable(temp_get_blob_percent_completed);
export let get_blob_percent_completed = temp_get_blob_percent_completed;
@@ -74,7 +76,7 @@ export let get_object = async function get_object(
}
// console.log('Clean the headers. No _underscores_!')
let headers_cleaned = {};
let headers_cleaned: key_val = {};
for (const prop in headers) {
// No underscores allowed in the header parameters!
let prop_cleaned = prop.replaceAll('_', '-');
@@ -340,3 +342,12 @@ export let get_object = async function get_object(
}
}
}
function resolved(result: any) {
console.log('Resolved');
}
function rejected(result: any) {
console.error(result);
}

View File

@@ -145,7 +145,7 @@ export let post_object = async function post_object(
);
console.log('POST Blob Progress:', progressEvent.progress, 'Total:', progressEvent.total, 'Loaded:', progressEvent.loaded, 'Percent Completed', percent_completed);
temp_get_blob_percent_completed = percent_completed;
temp_post_blob_percent_completed = percent_completed;
}
}
)
@@ -193,3 +193,12 @@ export let post_object = async function post_object(
}
}
}
function resolved(result: any) {
console.log('Resolved');
}
function rejected(result: any) {
console.error(result);
}