refactor: move server-only code (resolves #2)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { Session, User } from '@auth/sveltekit';
|
||||
import { error } from '@sveltejs/kit';
|
||||
import { db } from './server/db';
|
||||
import { users } from './server/db/schema';
|
||||
import { db } from './db';
|
||||
import { users } from './db/schema';
|
||||
import { eq } from 'drizzle-orm';
|
||||
interface Event {
|
||||
locals: {
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getSession as getSession } from '$lib/auth';
|
||||
import { getSession as getSession } from '$lib/server/session';
|
||||
import type { LayoutServerLoad } from './$types';
|
||||
|
||||
export const load: LayoutServerLoad = async (event) => {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { extractFormData } from '$lib/extractFormData';
|
||||
import { resolve } from '$app/paths';
|
||||
|
||||
import * as v from 'valibot';
|
||||
import { ensureAuth } from '$lib/auth';
|
||||
import { ensureAuth } from '$lib/server/session';
|
||||
import { db } from '$lib/server/db';
|
||||
import { aktis } from '$lib/server/db/schema';
|
||||
export const load: PageServerLoad = async (event) => {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { aktis, ratings } from '$lib/server/db/schema';
|
||||
import { error, redirect, type Actions } from '@sveltejs/kit';
|
||||
import { and, eq } from 'drizzle-orm';
|
||||
import type { PageServerLoad } from './$types';
|
||||
import { ensureAuth } from '$lib/auth';
|
||||
import { ensureAuth } from '$lib/server/session';
|
||||
import { extractFormData } from '$lib/extractFormData';
|
||||
import * as v from 'valibot';
|
||||
import { resolve } from '$app/paths';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { PageServerLoad } from './$types';
|
||||
import { ensureAuth } from '$lib/auth';
|
||||
import { ensureAuth } from '$lib/server/session';
|
||||
import { error, redirect, type Actions } from '@sveltejs/kit';
|
||||
import { extractFormData } from '$lib/extractFormData';
|
||||
import { aktis, ratings } from '$lib/server/db/schema';
|
||||
|
||||
Reference in New Issue
Block a user