Files
OSIT-AE-App-Svelte/src/routes/journals/+layout.ts
2025-04-02 12:56:08 -04:00

41 lines
1.3 KiB
TypeScript

/** @type {import('./$types').LayoutLoad} */
console.log(`ae_journals +layout.ts start`);
// Imports
import { browser } from '$app/environment';
// import { journals_func } from '$lib/ae_journals/ae_journals_functions';
export async function load({ params, parent }) {
let log_lvl: number = 0;
let parent_data = await parent();
// console.log(`ae_journals +layout.ts parent_data:`, parent_data);
let account_id = parent_data.account_id;
if (!account_id) {
console.log(`journals +layout.ts: The account_id was not found in the parent_data!!!`);
return false;
}
let ae_acct = parent_data[account_id];
if (log_lvl) {
console.log(`ae_acct = `, ae_acct);
}
// let submenu = {
// main: {name: 'Main', href: '/journals', access: false},
// // manage: {name: 'Manage', href: '/journals/manage', access: 'administrator', disable: true, hide: true},
// locations: {name: 'Locations', href: `/journals/${note_id}/locations`, access: false, disable: false, hide: false},
// };
// parent_data.submenu = submenu
// WARNING: Precaution against shared parent_data between sites and sessions.
parent_data[account_id] = ae_acct;
return parent_data;
}
// export const prerender = false;
// export const prerender = true;