/**
 * src/routes/events/[event_id]/(leads)/leads/lead/[exhibit_tracking_id]/+page.ts
 * Lead Detail Page Loader.
 * Responsible for loading a single exhibit tracking record and its associated badge data.
 */
import { browser } from '$app/environment';
import { events_func } from '$lib/ae_events/ae_events_functions';

export async function load({ params, parent }) {
    const parent_data = await parent();
    const account_id = parent_data.account_id;
    const ae_acct = parent_data[account_id];
    const exhibit_tracking_id = params.exhibit_tracking_id;

    if (browser && exhibit_tracking_id) {
        // Refresh the specific Lead (Tracking) object
        events_func.load_ae_obj_id__event_exhibit_tracking({
            api_cfg: ae_acct.api,
            exhibit_tracking_id: exhibit_tracking_id,
            log_lvl: 0
        });
    }

    return {};
}
