General clean up and renaming of functions.

This commit is contained in:
Scott Idem
2024-08-19 14:53:28 -04:00
parent 6aa499c79b
commit 75b0e53114
6 changed files with 17 additions and 116 deletions

View File

@@ -36,7 +36,7 @@ export async function handle_load_ae_obj_id__event_file(
.then(function (event_file_obj_get_result) {
if (event_file_obj_get_result) {
// This is expecting a list
handle_db_save_ae_obj_li__event_file({obj_type: 'event_file', obj_li: [event_file_obj_get_result]});
db_save_ae_obj_li__event_file({obj_type: 'event_file', obj_li: [event_file_obj_get_result]});
return event_file_obj_get_result;
} else {
console.log('No results returned.');
@@ -106,7 +106,7 @@ export async function handle_load_ae_obj_li__event_file(
.then(function (event_file_obj_li_get_result) {
if (event_file_obj_li_get_result) {
if (try_cache) {
handle_db_save_ae_obj_li__event_file({obj_type: 'event_file', obj_li: event_file_obj_li_get_result});
db_save_ae_obj_li__event_file({obj_type: 'event_file', obj_li: event_file_obj_li_get_result});
}
return event_file_obj_li_get_result;
} else {
@@ -252,9 +252,9 @@ export async function handle_update_ae_obj__event_file(
})
.then(function (event_file_obj_update_result) {
if (event_file_obj_update_result) {
// handle_db_save_ae_obj_li__event_file({obj_type: 'event_file', obj_li: [event_file_obj_update_result]});
// db_save_ae_obj_li__event_file({obj_type: 'event_file', obj_li: [event_file_obj_update_result]});
// Very important: The results returned from the API does not include fields from the DB views. It is the actual table fields only.
handle_db_update_ae_obj_id__event_file({obj_type: 'event_file', obj_id: event_file_id, data_kv: event_file_obj_update_result});
db_update_ae_obj_id__event_file({obj_type: 'event_file', obj_id: event_file_id, data_kv: event_file_obj_update_result});
return event_file_obj_update_result;
} else {
return null;
@@ -274,7 +274,7 @@ export async function handle_update_ae_obj__event_file(
// Updated 2024-07-12
export async function handle_search__event_file(
export async function search__event_file(
{
api_cfg,
event_id,
@@ -304,7 +304,7 @@ export async function handle_search__event_file(
}
) {
if (log_lvl) {
console.log(`*** handle_search__event_file() *** event_id=${event_id}`);
console.log(`*** search__event_file() *** event_id=${event_id}`);
}
let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
@@ -379,7 +379,7 @@ export async function handle_search__event_file(
})
.then(function (event_file_obj_li_get_result) {
if (event_file_obj_li_get_result) {
handle_db_save_ae_obj_li__event_file({obj_type: 'event_file', obj_li: event_file_obj_li_get_result});
db_save_ae_obj_li__event_file({obj_type: 'event_file', obj_li: event_file_obj_li_get_result});
return event_file_obj_li_get_result;
} else {
return [];
@@ -399,7 +399,7 @@ export async function handle_search__event_file(
// This function will loop through the event_file_obj_li and save each one to the DB.
export function handle_db_save_ae_obj_li__event_file(
export function db_save_ae_obj_li__event_file(
{
obj_type,
obj_li,
@@ -411,7 +411,7 @@ export function handle_db_save_ae_obj_li__event_file(
}
) {
if (log_lvl) {
console.log(`*** handle_db_save_ae_obj_li__event_file() ***`);
console.log(`*** db_save_ae_obj_li__event_file() ***`);
}
if (obj_li && obj_li.length) {
@@ -494,7 +494,7 @@ export function handle_db_save_ae_obj_li__event_file(
}
export function handle_db_update_ae_obj_id__event_file(
export function db_update_ae_obj_id__event_file(
{
obj_type,
obj_id,
@@ -505,7 +505,7 @@ export function handle_db_update_ae_obj_id__event_file(
data_kv: key_val
}
) {
console.log(`*** handle_db_update_ae_obj_id__event_file() ***`);
console.log(`*** db_update_ae_obj_id__event_file() ***`);
if (obj_id) {
console.log(`ae_obj ${obj_type}:`, obj_id);

View File

@@ -12,8 +12,8 @@ import {
handle_delete_ae_obj_id__event_file,
create_event_file_obj_from_hosted_file_async,
handle_update_ae_obj__event_file,
handle_search__event_file,
handle_db_save_ae_obj_li__event_file,
search__event_file,
db_save_ae_obj_li__event_file,
} from "$lib/ae_events__event_file";
import {
@@ -78,8 +78,8 @@ let export_obj = {
handle_load_ae_obj_li__event_file: handle_load_ae_obj_li__event_file,
handle_delete_ae_obj_id__event_file: handle_delete_ae_obj_id__event_file,
handle_update_ae_obj__event_file: handle_update_ae_obj__event_file,
handle_search__event_file: handle_search__event_file,
handle_db_save_ae_obj_li__event_file: handle_db_save_ae_obj_li__event_file,
search__event_file: search__event_file,
db_save_ae_obj_li__event_file: db_save_ae_obj_li__event_file,
load_ae_obj_id__event_location: load_ae_obj_id__event_location,
load_ae_obj_li__event_location: load_ae_obj_li__event_location,

View File

@@ -16,7 +16,6 @@ import { ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_st
import { db_events } from "$lib/db_events";
import { events_loc, events_sess, events_slct, events_trigger } from '$lib/ae_events_stores';
import { events_func } from '$lib/ae_events_functions';
import { hide } from '@floating-ui/dom';
export let container_class_li: string|Array<string> = [];
export let link_to_type: string;