Skip to content

Commit

Permalink
♻️ Refactor load function in +layout.ts to remove database instance l…
Browse files Browse the repository at this point in the history
…ogging for cleaner code
  • Loading branch information
pitzzahh authored Dec 13, 2024
1 parent 89dd750 commit ede778f
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/routes/(workspaces)/+layout.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
import { highest_unit_schema } from '@/schema';
import { superValidate } from 'sveltekit-superforms';
import { zod } from 'sveltekit-superforms/adapters';
import { databaseInstance } from '@/db';
import { generic_phase_panel_schema } from '@/schema/panel';
import { getCurrentProject, getRootNode } from '@/db/queries/index.js';

import { generic_phase_main_load_schema } from '@/schema/load';

export const load = async ({ url: { searchParams } }) => {
console.log('INIT DB');
const database = await databaseInstance();
console.log(database);

const project = (await getCurrentProject());
// const nodes = project ? await getChildNodesByParentId(project.id) : [];
const root_node = (await getRootNode());

return {
is_new_file: searchParams.get('new_file') === 'true',
is_load_file: searchParams.get('load_file') === 'true',
Expand Down

0 comments on commit ede778f

Please sign in to comment.