Work on location views and editing. Also session list clean up.
This commit is contained in:
@@ -11,11 +11,15 @@ export async function load_ae_obj_id__event_presentation(
|
||||
{
|
||||
api_cfg,
|
||||
event_presentation_id,
|
||||
try_cache=false,
|
||||
log_lvl=0
|
||||
inc_file_li = false,
|
||||
inc_presenter_li = false,
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
}: {
|
||||
api_cfg: any,
|
||||
event_presentation_id: string,
|
||||
inc_file_li?: boolean,
|
||||
inc_presenter_li?: boolean
|
||||
try_cache?: boolean,
|
||||
log_lvl?: number
|
||||
}
|
||||
@@ -35,8 +39,14 @@ export async function load_ae_obj_id__event_presentation(
|
||||
})
|
||||
.then(function (event_presentation_obj_get_result) {
|
||||
if (event_presentation_obj_get_result) {
|
||||
// This is expecting a list
|
||||
db_save_ae_obj_li__event_presentation({obj_type: 'event_presentation', obj_li: [event_presentation_obj_get_result]});
|
||||
if (try_cache) {
|
||||
// This is expecting a list
|
||||
db_save_ae_obj_li__event_presentation({
|
||||
obj_type: 'event_presentation',
|
||||
obj_li: [event_presentation_obj_get_result]
|
||||
|
||||
});
|
||||
}
|
||||
return event_presentation_obj_get_result;
|
||||
} else {
|
||||
console.log('No results returned.');
|
||||
@@ -47,6 +57,20 @@ export async function load_ae_obj_id__event_presentation(
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
if (inc_file_li) {
|
||||
// Load the files for the presentation
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the file list for the presentation now.`);
|
||||
}
|
||||
}
|
||||
|
||||
if (inc_presenter_li) {
|
||||
// Load the presenters for the presentation
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the presenter list for the presentation now.`);
|
||||
}
|
||||
}
|
||||
|
||||
return ae_promises.load__event_presentation_obj;
|
||||
}
|
||||
|
||||
@@ -55,19 +79,25 @@ export async function load_ae_obj_id__event_presentation(
|
||||
export async function load_ae_obj_li__event_presentation(
|
||||
{
|
||||
api_cfg,
|
||||
event_session_id,
|
||||
params={},
|
||||
try_cache=true,
|
||||
log_lvl=0
|
||||
for_obj_type,
|
||||
for_obj_id,
|
||||
inc_file_li = false,
|
||||
inc_presenter_li = false,
|
||||
params = {},
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
}: {
|
||||
api_cfg: any,
|
||||
event_session_id: string,
|
||||
for_obj_type: string,
|
||||
for_obj_id: string,
|
||||
inc_file_li?: boolean,
|
||||
inc_presenter_li?: boolean
|
||||
params?: key_val,
|
||||
try_cache?: boolean,
|
||||
log_lvl?: number
|
||||
}
|
||||
) {
|
||||
console.log(`*** load_ae_obj_li__event_presentation() *** event_session_id=${event_session_id}`);
|
||||
console.log(`*** load_ae_obj_li__event_presentation() *** for_obj_type=${for_obj_type} for_obj_id=${for_obj_id}`);
|
||||
|
||||
let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
|
||||
let hidden: string = (params.qry__hidden ?? 'not_hidden'); // all, hidden, not_hidden
|
||||
@@ -81,8 +111,8 @@ export async function load_ae_obj_li__event_presentation(
|
||||
ae_promises.load__event_presentation_obj_li = await api.get_ae_obj_li_for_obj_id_crud({
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'event_presentation',
|
||||
for_obj_type: 'event_session',
|
||||
for_obj_id: event_session_id,
|
||||
for_obj_type: for_obj_type,
|
||||
for_obj_id: for_obj_id,
|
||||
use_alt_table: true, // NOTE: This will use the table_name_alt value instead of the table_name value in the API config.
|
||||
use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value
|
||||
enabled: enabled,
|
||||
@@ -96,7 +126,11 @@ export async function load_ae_obj_li__event_presentation(
|
||||
})
|
||||
.then(function (event_presentation_obj_li_get_result) {
|
||||
if (event_presentation_obj_li_get_result) {
|
||||
db_save_ae_obj_li__event_presentation({obj_type: 'event_presentation', obj_li: event_presentation_obj_li_get_result});
|
||||
if (try_cache) {
|
||||
db_save_ae_obj_li__event_presentation({
|
||||
obj_type: 'event_presentation', obj_li: event_presentation_obj_li_get_result
|
||||
});
|
||||
}
|
||||
return event_presentation_obj_li_get_result;
|
||||
} else {
|
||||
return [];
|
||||
@@ -109,6 +143,21 @@ export async function load_ae_obj_li__event_presentation(
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.load__event_presentation_obj_li:', ae_promises.load__event_presentation_obj_li);
|
||||
}
|
||||
|
||||
if (inc_file_li) {
|
||||
// Load the files for the presentations
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the file list for each presentation now.`);
|
||||
}
|
||||
}
|
||||
|
||||
if (inc_presenter_li) {
|
||||
// Load the presenters for the presentations
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the presenter list for each presentation now.`);
|
||||
}
|
||||
}
|
||||
|
||||
return ae_promises.load__event_presentation_obj_li;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user