1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-08-05 13:15:18 +02:00

Add server-side code to load shared adventure by key

This commit is contained in:
Sean Morley 2024-04-02 19:09:03 +00:00
parent 56a8a45efb
commit 0dde2fbe6a
2 changed files with 9 additions and 0 deletions

View file

@ -0,0 +1,9 @@
import { db } from "$lib/db/db.server";
import { sharedAdventures } from "$lib/db/schema";
import { eq } from "drizzle-orm";
export async function load({ params }) {
let key = params.key;
let result = await db.select().from(sharedAdventures).where(eq(sharedAdventures.id, key)).execute();
console.log(result);
};

View file