Migrate Posts and Event Presentations to unified type system
- Integrated ae_Post, ae_PostComment, ae_Page, and ae_Archive types into logic files. - Replaced local interfaces in ae_posts__post.ts and ae_posts__post_comment.ts. - Standardized Promise return types for all CRUD and loading functions in Post and Presentation modules. - Synchronized event presentation logic with V3 triple-ID patterns.
This commit is contained in:
@@ -3,6 +3,7 @@ import { api } from '$lib/api/api';
|
||||
|
||||
import { db_save_ae_obj_li__ae_obj } from '$lib/ae_core/core__idb_dexie';
|
||||
import { db_events } from '$lib/ae_events/db_events';
|
||||
import type { ae_EventPresentation } from '$lib/types/ae_types';
|
||||
|
||||
import { load_ae_obj_li__event_file } from '$lib/ae_events/ae_events__event_file';
|
||||
import { load_ae_obj_li__event_presenter } from '$lib/ae_events/ae_events__event_presenter';
|
||||
@@ -32,7 +33,7 @@ export async function load_ae_obj_id__event_presentation({
|
||||
offset?: number;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_EventPresentation | null> {
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
`*** load_ae_obj_id__event_presentation() *** event_presentation_id=${event_presentation_id}`
|
||||
@@ -202,7 +203,7 @@ export async function load_ae_obj_li__event_presentation({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_EventPresentation[]> {
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
`*** load_ae_obj_li__event_presentation() *** for_obj_type=${for_obj_type} for_obj_id=${for_obj_id}`
|
||||
@@ -369,7 +370,7 @@ export async function create_ae_obj__event_presentation({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_EventPresentation | null> {
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
`*** create_ae_obj__event_presentation() *** event_id=${event_id} event_session_id=${event_session_id}`
|
||||
@@ -512,7 +513,7 @@ export async function update_ae_obj__event_presentation({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_EventPresentation | null> {
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
`*** update_ae_obj__event_presentation() *** event_presentation_id=${event_presentation_id}`,
|
||||
|
||||
@@ -3,6 +3,7 @@ import { api } from '$lib/api/api';
|
||||
|
||||
import { db_save_ae_obj_li__ae_obj } from '$lib/ae_core/core__idb_dexie';
|
||||
import { db_posts } from '$lib/ae_posts/db_posts';
|
||||
import type { ae_Post } from '$lib/types/ae_types';
|
||||
|
||||
import { load_ae_obj_li__post_comment } from '$lib/ae_posts/ae_posts__post_comment';
|
||||
|
||||
@@ -33,7 +34,7 @@ export async function load_ae_obj_id__post({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_Post | null> {
|
||||
if (log_lvl) {
|
||||
console.log(`*** load_ae_obj_id__post() *** post_id=${post_id}`);
|
||||
}
|
||||
@@ -124,7 +125,7 @@ export async function load_ae_obj_li__post({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_Post[]> {
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
`*** load_ae_obj_li__post() *** for_obj_type=${for_obj_type} for_obj_id=${for_obj_id}`
|
||||
@@ -203,7 +204,7 @@ export async function create_ae_obj__post({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_Post | null> {
|
||||
if (log_lvl) {
|
||||
console.log(`*** create_ae_obj__post() *** account_id=${account_id}`);
|
||||
}
|
||||
@@ -288,7 +289,7 @@ export async function update_ae_obj__post({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_Post | null> {
|
||||
if (log_lvl) {
|
||||
console.log(`*** update_ae_obj__post() *** post_id=${post_id}`, data_kv);
|
||||
}
|
||||
@@ -353,7 +354,7 @@ export async function qry__post({
|
||||
offset?: number;
|
||||
order_by_li?: Record<string, 'ASC' | 'DESC'>;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_Post[]> {
|
||||
const search_query: any = { and: [] };
|
||||
|
||||
if (account_id) {
|
||||
|
||||
@@ -3,6 +3,7 @@ import { api } from '$lib/api/api';
|
||||
|
||||
import { db_save_ae_obj_li__ae_obj } from '$lib/ae_core/core__idb_dexie';
|
||||
import { db_posts } from '$lib/ae_posts/db_posts';
|
||||
import type { ae_PostComment } from '$lib/types/ae_types';
|
||||
|
||||
const ae_promises: key_val = {};
|
||||
|
||||
@@ -21,7 +22,7 @@ export async function load_ae_obj_id__post_comment({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_PostComment | null> {
|
||||
if (log_lvl) {
|
||||
console.log(`*** load_ae_obj_id__post_comment() *** post_comment_id=${post_comment_id}`);
|
||||
}
|
||||
@@ -96,7 +97,7 @@ export async function load_ae_obj_li__post_comment({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_PostComment[]> {
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
`*** load_ae_obj_li__post_comment() *** for_obj_type=${for_obj_type} for_obj_id=${for_obj_id}`
|
||||
@@ -156,7 +157,7 @@ export async function create_ae_obj__post_comment({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_PostComment | null> {
|
||||
if (log_lvl) {
|
||||
console.log(`*** create_ae_obj__post_comment() *** post_id=${post_id}`);
|
||||
}
|
||||
@@ -240,7 +241,7 @@ export async function update_ae_obj__post_comment({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_PostComment | null> {
|
||||
if (log_lvl) {
|
||||
console.log(`*** update_ae_obj__post_comment() *** post_comment_id=${post_comment_id}`, data_kv);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user