mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
Cleaning up and removing prisma.
This commit is contained in:
parent
d86b975b4e
commit
bd7d944ad1
5 changed files with 26 additions and 27 deletions
|
|
@ -4,7 +4,7 @@
|
|||
"private": "true",
|
||||
"scripts": {
|
||||
"dev": "NODE_OPTIONS=\"--inspect\" vite dev --host",
|
||||
"build": "drizzle-kit generate:pg && vite build",
|
||||
"build": "vite build",
|
||||
"package": "svelte-kit package",
|
||||
"preview": "vite preview",
|
||||
"test": "playwright test",
|
||||
|
|
@ -95,7 +95,7 @@
|
|||
"class-variance-authority": "^0.7.0",
|
||||
"clsx": "^2.1.0",
|
||||
"cookie": "^0.6.0",
|
||||
"drizzle-orm": "^0.29.4",
|
||||
"drizzle-orm": "^0.29.5",
|
||||
"feather-icons": "^4.29.1",
|
||||
"formsnap": "^0.5.1",
|
||||
"html-entities": "^2.5.2",
|
||||
|
|
@ -106,7 +106,7 @@
|
|||
"lucide-svelte": "^0.344.0",
|
||||
"mysql2": "^3.9.2",
|
||||
"nanoid": "^5.0.6",
|
||||
"open-props": "^1.6.20",
|
||||
"open-props": "^1.6.21",
|
||||
"oslo": "^1.1.3",
|
||||
"pg": "^8.11.3",
|
||||
"postgres": "^3.4.3",
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ dependencies:
|
|||
version: 1.0.2(lucia@3.0.1)
|
||||
'@lucia-auth/adapter-prisma':
|
||||
specifier: 4.0.0
|
||||
version: 4.0.0(@prisma/client@5.9.1)(lucia@3.0.1)
|
||||
version: 4.0.0(@prisma/client@5.10.2)(lucia@3.0.1)
|
||||
'@lukeed/uuid':
|
||||
specifier: ^2.0.1
|
||||
version: 2.0.1
|
||||
|
|
@ -60,8 +60,8 @@ dependencies:
|
|||
specifier: ^0.6.0
|
||||
version: 0.6.0
|
||||
drizzle-orm:
|
||||
specifier: ^0.29.4
|
||||
version: 0.29.4(@neondatabase/serverless@0.9.0)(@planetscale/database@1.16.0)(@types/pg@8.11.2)(mysql2@3.9.2)(pg@8.11.3)(postgres@3.4.3)
|
||||
specifier: ^0.29.5
|
||||
version: 0.29.5(@neondatabase/serverless@0.9.0)(@planetscale/database@1.16.0)(@types/pg@8.11.2)(mysql2@3.9.2)(pg@8.11.3)(postgres@3.4.3)
|
||||
feather-icons:
|
||||
specifier: ^4.29.1
|
||||
version: 4.29.1
|
||||
|
|
@ -93,8 +93,8 @@ dependencies:
|
|||
specifier: ^5.0.6
|
||||
version: 5.0.6
|
||||
open-props:
|
||||
specifier: ^1.6.20
|
||||
version: 1.6.20
|
||||
specifier: ^1.6.21
|
||||
version: 1.6.21
|
||||
oslo:
|
||||
specifier: ^1.1.3
|
||||
version: 1.1.3
|
||||
|
|
@ -1938,13 +1938,13 @@ packages:
|
|||
lucia: 3.0.1
|
||||
dev: false
|
||||
|
||||
/@lucia-auth/adapter-prisma@4.0.0(@prisma/client@5.9.1)(lucia@3.0.1):
|
||||
/@lucia-auth/adapter-prisma@4.0.0(@prisma/client@5.10.2)(lucia@3.0.1):
|
||||
resolution: {integrity: sha512-TJg4/U1K1slS4A/OzDYCgmHTrIArntIynue14zGIEaMDu+OD+tGyq9WwQWqOabpx2Gm9xtDsoK+tTokAY3Up7A==}
|
||||
peerDependencies:
|
||||
'@prisma/client': ^4.2.0 || ^5.0.0
|
||||
lucia: 3.x
|
||||
dependencies:
|
||||
'@prisma/client': 5.9.1
|
||||
'@prisma/client': 5.10.2
|
||||
lucia: 3.0.1
|
||||
dev: false
|
||||
|
||||
|
|
@ -2665,8 +2665,8 @@ packages:
|
|||
requiresBuild: true
|
||||
optional: true
|
||||
|
||||
/@prisma/client@5.9.1:
|
||||
resolution: {integrity: sha512-caSOnG4kxcSkhqC/2ShV7rEoWwd3XrftokxJqOCMVvia4NYV/TPtJlS9C2os3Igxw/Qyxumj9GBQzcStzECvtQ==}
|
||||
/@prisma/client@5.10.2:
|
||||
resolution: {integrity: sha512-ef49hzB2yJZCvM5gFHMxSFL9KYrIP9udpT5rYo0CsHD4P9IKj473MbhU1gjKKftiwWBTIyrt9jukprzZXazyag==}
|
||||
engines: {node: '>=16.13'}
|
||||
requiresBuild: true
|
||||
peerDependencies:
|
||||
|
|
@ -4243,8 +4243,8 @@ packages:
|
|||
- supports-color
|
||||
dev: true
|
||||
|
||||
/drizzle-orm@0.29.4(@neondatabase/serverless@0.9.0)(@planetscale/database@1.16.0)(@types/pg@8.11.2)(mysql2@3.9.2)(pg@8.11.3)(postgres@3.4.3):
|
||||
resolution: {integrity: sha512-ZnSM8TAxFhzH7p1s3+w3pRE/eKaOeNkH9SKitm717pubDVVcV2I0BCDBPGKV+pe02+wMfw37ntlTcCyo2rA3IA==}
|
||||
/drizzle-orm@0.29.5(@neondatabase/serverless@0.9.0)(@planetscale/database@1.16.0)(@types/pg@8.11.2)(mysql2@3.9.2)(pg@8.11.3)(postgres@3.4.3):
|
||||
resolution: {integrity: sha512-jS3+uyzTz4P0Y2CICx8FmRQ1eplURPaIMWDn/yq6k4ShRFj9V7vlJk67lSf2kyYPzQ60GkkNGXcJcwrxZ6QCRw==}
|
||||
peerDependencies:
|
||||
'@aws-sdk/client-rds-data': '>=3'
|
||||
'@cloudflare/workers-types': '>=3'
|
||||
|
|
@ -5791,8 +5791,8 @@ packages:
|
|||
mimic-fn: 4.0.0
|
||||
dev: true
|
||||
|
||||
/open-props@1.6.20:
|
||||
resolution: {integrity: sha512-RwDLtSd785gWnotUZC1rICmFWkeNNQzOd91k3DL0jrwQ7xV5wi9EwGKDK2eiOyPl11/Vx+Btc+dIwCBD2MBpxw==}
|
||||
/open-props@1.6.21:
|
||||
resolution: {integrity: sha512-leK6x7SvLX3K/idbHyFrnwoygaB0YBBMecQ5FJcms/Oqn82b/FIqgMyuLeSqGxpFOwIPdvMirFGpiB74ef+ULg==}
|
||||
dev: false
|
||||
|
||||
/optionator@0.9.3:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts">
|
||||
import { applyAction, enhance } from '$app/forms';
|
||||
import toast from 'svelte-french-toast';
|
||||
import { ListChecks, ListTodo, LogOut } from 'lucide-svelte';
|
||||
import { ListChecks, ListTodo, LogOut, User } from 'lucide-svelte';
|
||||
import * as DropdownMenu from "$components/ui/dropdown-menu";
|
||||
import * as Avatar from "$components/ui/avatar";
|
||||
import { invalidateAll } from '$app/navigation';
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { error, type Actions } from '@sveltejs/kit';
|
||||
import { and, eq } from 'drizzle-orm';
|
||||
import { zod } from 'sveltekit-superforms/adapters';
|
||||
import { superValidate } from 'sveltekit-superforms/server';
|
||||
import { redirect } from 'sveltekit-flash-message/server';
|
||||
import { modifyListGameSchema } from '$lib/validations/zod-schemas';
|
||||
import db from '$lib/drizzle.js';
|
||||
import { and, eq } from 'drizzle-orm';
|
||||
import { games, wishlist_items, wishlists } from '../../../../schema.js';
|
||||
import { notSignedInMessage } from '$lib/flashMessages.js';
|
||||
import { games, wishlist_items, wishlists } from '../../../../schema.js';
|
||||
|
||||
export async function load(event) {
|
||||
const { params, locals } = event;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
import { error, json } from '@sveltejs/kit';
|
||||
import prisma from '$lib/prisma';
|
||||
import { eq } from 'drizzle-orm';
|
||||
import db from '$lib/drizzle.js';
|
||||
import { collection_items, collection_items, users } from '../../../../../schema.js';
|
||||
|
||||
// Search a user's collection
|
||||
export async function GET({ url, locals, params }) {
|
||||
|
|
@ -18,10 +20,8 @@ export async function GET({ url, locals, params }) {
|
|||
error(401, { message: 'Unauthorized' });
|
||||
}
|
||||
|
||||
let collection = await prisma.collection.findUnique({
|
||||
where: {
|
||||
user_id: locals.user.userId
|
||||
}
|
||||
const collection = await db.query.collections.findFirst({
|
||||
where: eq(users.id, locals?.user?.userId)
|
||||
});
|
||||
console.log('collection', collection);
|
||||
|
||||
|
|
@ -32,9 +32,8 @@ export async function GET({ url, locals, params }) {
|
|||
|
||||
try {
|
||||
const orderBy = { [sort]: order };
|
||||
let collection_items = await prisma.collectionItem.findMany({
|
||||
where: {
|
||||
collection_id,
|
||||
let collection_items = await db.query.collection_items.findMany({
|
||||
where: eq(collection_items.collection_id, collection_id),
|
||||
AND: [
|
||||
{
|
||||
game: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue