fix(events): robust date sorting in core event processors
This commit is contained in:
@@ -242,7 +242,9 @@ export async function delete_ae_obj_id__event_presentation({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
const result = await api.delete_ae_obj_v3({ api_cfg, obj_type: 'event_presentation', obj_id: event_presentation_id, method, log_lvl });
|
||||
const result = await api.delete_ae_obj_v3({
|
||||
api_cfg, obj_type: 'event_presentation', obj_id: event_presentation_id, method, log_lvl
|
||||
});
|
||||
if (try_cache) await db_events.presentation.delete(event_presentation_id);
|
||||
return result;
|
||||
}
|
||||
@@ -261,7 +263,9 @@ export async function update_ae_obj__event_presentation({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_EventPresentation | null> {
|
||||
const result = await api.update_ae_obj_v3({ api_cfg, obj_type: 'event_presentation', obj_id: event_presentation_id, fields: data_kv, log_lvl });
|
||||
const result = await api.update_ae_obj_v3({
|
||||
api_cfg, obj_type: 'event_presentation', obj_id: event_presentation_id, fields: data_kv, log_lvl
|
||||
});
|
||||
if (result) {
|
||||
const processed = await process_ae_obj__event_presentation_props({ obj_li: [result], log_lvl });
|
||||
const processed_obj = processed[0];
|
||||
@@ -323,7 +327,7 @@ async function _process_generic_props<T extends Record<string, any>>({ obj_li, o
|
||||
const group = processed_obj.group ?? '0';
|
||||
const priority = processed_obj.priority ? 1 : 0;
|
||||
const sort = processed_obj.sort ?? '0';
|
||||
const updated = processed_obj.updated_on ?? processed_obj.created_on;
|
||||
const updated = processed_obj.updated_on ?? processed_obj.created_on ?? new Date(0).toISOString();
|
||||
const name = processed_obj.name ?? '';
|
||||
(processed_obj as any).tmp_sort_1 = `${group}_${priority}_${sort}_${updated}`;
|
||||
(processed_obj as any).tmp_sort_2 = `${group}_${priority}_${sort}_${name}_${updated}`;
|
||||
|
||||
Reference in New Issue
Block a user