mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
Update lucia, super form, and flash message. Fix get game by id when no user is signed in.
This commit is contained in:
parent
e086274735
commit
af475071eb
5 changed files with 79 additions and 75 deletions
|
|
@ -49,8 +49,8 @@
|
||||||
"svelte-check": "^3.5.0",
|
"svelte-check": "^3.5.0",
|
||||||
"svelte-preprocess": "^5.0.4",
|
"svelte-preprocess": "^5.0.4",
|
||||||
"svelte-sequential-preprocessor": "^2.0.1",
|
"svelte-sequential-preprocessor": "^2.0.1",
|
||||||
"sveltekit-flash-message": "^2.1.3",
|
"sveltekit-flash-message": "^2.2.0",
|
||||||
"sveltekit-superforms": "^1.5.1",
|
"sveltekit-superforms": "^1.6.0",
|
||||||
"tailwindcss": "^3.3.3",
|
"tailwindcss": "^3.3.3",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"tslib": "^2.6.1",
|
"tslib": "^2.6.1",
|
||||||
|
|
@ -78,11 +78,11 @@
|
||||||
"class-variance-authority": "^0.6.1",
|
"class-variance-authority": "^0.6.1",
|
||||||
"clsx": "^1.2.1",
|
"clsx": "^1.2.1",
|
||||||
"cookie": "^0.5.0",
|
"cookie": "^0.5.0",
|
||||||
"feather-icons": "^4.29.0",
|
"feather-icons": "^4.29.1",
|
||||||
"iconify-icon": "^1.0.8",
|
"iconify-icon": "^1.0.8",
|
||||||
"just-kebab-case": "^4.2.0",
|
"just-kebab-case": "^4.2.0",
|
||||||
"loader": "^2.1.1",
|
"loader": "^2.1.1",
|
||||||
"lucia": "^2.3.0",
|
"lucia": "^2.4.0",
|
||||||
"lucide-svelte": "^0.256.1",
|
"lucide-svelte": "^0.256.1",
|
||||||
"open-props": "^1.5.11",
|
"open-props": "^1.5.11",
|
||||||
"radix-svelte": "^0.8.0",
|
"radix-svelte": "^0.8.0",
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,10 @@ dependencies:
|
||||||
version: 1.2.47
|
version: 1.2.47
|
||||||
'@lucia-auth/adapter-mysql':
|
'@lucia-auth/adapter-mysql':
|
||||||
specifier: ^2.0.0
|
specifier: ^2.0.0
|
||||||
version: 2.0.0(lucia@2.3.0)
|
version: 2.0.0(lucia@2.4.0)
|
||||||
'@lucia-auth/adapter-prisma':
|
'@lucia-auth/adapter-prisma':
|
||||||
specifier: ^3.0.1
|
specifier: ^3.0.1
|
||||||
version: 3.0.1(@prisma/client@5.1.1)(lucia@2.3.0)
|
version: 3.0.1(@prisma/client@5.1.1)(lucia@2.4.0)
|
||||||
'@lukeed/uuid':
|
'@lukeed/uuid':
|
||||||
specifier: ^2.0.1
|
specifier: ^2.0.1
|
||||||
version: 2.0.1
|
version: 2.0.1
|
||||||
|
|
@ -45,8 +45,8 @@ dependencies:
|
||||||
specifier: ^0.5.0
|
specifier: ^0.5.0
|
||||||
version: 0.5.0
|
version: 0.5.0
|
||||||
feather-icons:
|
feather-icons:
|
||||||
specifier: ^4.29.0
|
specifier: ^4.29.1
|
||||||
version: 4.29.0
|
version: 4.29.1
|
||||||
iconify-icon:
|
iconify-icon:
|
||||||
specifier: ^1.0.8
|
specifier: ^1.0.8
|
||||||
version: 1.0.8
|
version: 1.0.8
|
||||||
|
|
@ -57,8 +57,8 @@ dependencies:
|
||||||
specifier: ^2.1.1
|
specifier: ^2.1.1
|
||||||
version: 2.1.1
|
version: 2.1.1
|
||||||
lucia:
|
lucia:
|
||||||
specifier: ^2.3.0
|
specifier: ^2.4.0
|
||||||
version: 2.3.0
|
version: 2.4.0
|
||||||
lucide-svelte:
|
lucide-svelte:
|
||||||
specifier: ^0.256.1
|
specifier: ^0.256.1
|
||||||
version: 0.256.1(svelte@4.2.0)
|
version: 0.256.1(svelte@4.2.0)
|
||||||
|
|
@ -173,11 +173,11 @@ devDependencies:
|
||||||
specifier: ^2.0.1
|
specifier: ^2.0.1
|
||||||
version: 2.0.1
|
version: 2.0.1
|
||||||
sveltekit-flash-message:
|
sveltekit-flash-message:
|
||||||
specifier: ^2.1.3
|
specifier: ^2.2.0
|
||||||
version: 2.1.3(@sveltejs/kit@1.22.6)(svelte@4.2.0)
|
version: 2.2.0(@sveltejs/kit@1.22.6)(svelte@4.2.0)
|
||||||
sveltekit-superforms:
|
sveltekit-superforms:
|
||||||
specifier: ^1.5.1
|
specifier: ^1.6.0
|
||||||
version: 1.5.1(@sveltejs/kit@1.22.6)(svelte@4.2.0)(zod@3.21.4)
|
version: 1.6.0(@sveltejs/kit@1.22.6)(svelte@4.2.0)(zod@3.21.4)
|
||||||
tailwindcss:
|
tailwindcss:
|
||||||
specifier: ^3.3.3
|
specifier: ^3.3.3
|
||||||
version: 3.3.3(ts-node@10.9.1)
|
version: 3.3.3(ts-node@10.9.1)
|
||||||
|
|
@ -1168,7 +1168,7 @@ packages:
|
||||||
'@jridgewell/resolve-uri': 3.1.0
|
'@jridgewell/resolve-uri': 3.1.0
|
||||||
'@jridgewell/sourcemap-codec': 1.4.15
|
'@jridgewell/sourcemap-codec': 1.4.15
|
||||||
|
|
||||||
/@lucia-auth/adapter-mysql@2.0.0(lucia@2.3.0):
|
/@lucia-auth/adapter-mysql@2.0.0(lucia@2.4.0):
|
||||||
resolution: {integrity: sha512-8a4JZ3VjDyRu/mAop2hEt/jOJO2HXwWIAid6a4wGiR8wgnlyOws9brRc+/wxQHSOlWUlrWemrfDvXLs5mMtkeQ==}
|
resolution: {integrity: sha512-8a4JZ3VjDyRu/mAop2hEt/jOJO2HXwWIAid6a4wGiR8wgnlyOws9brRc+/wxQHSOlWUlrWemrfDvXLs5mMtkeQ==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@planetscale/database': ^1.0.0
|
'@planetscale/database': ^1.0.0
|
||||||
|
|
@ -1180,17 +1180,17 @@ packages:
|
||||||
mysql2:
|
mysql2:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
lucia: 2.3.0
|
lucia: 2.4.0
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@lucia-auth/adapter-prisma@3.0.1(@prisma/client@5.1.1)(lucia@2.3.0):
|
/@lucia-auth/adapter-prisma@3.0.1(@prisma/client@5.1.1)(lucia@2.4.0):
|
||||||
resolution: {integrity: sha512-JZNl+721M5ApjtNiH+WUYstiC8cffcI/Y9IzKsa0uUhQMIHl2ObCrgO0R3fgHnjWHBjhQoK36g/r/iSJIDppBA==}
|
resolution: {integrity: sha512-JZNl+721M5ApjtNiH+WUYstiC8cffcI/Y9IzKsa0uUhQMIHl2ObCrgO0R3fgHnjWHBjhQoK36g/r/iSJIDppBA==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@prisma/client': ^4.2.0 || ^5.0.0
|
'@prisma/client': ^4.2.0 || ^5.0.0
|
||||||
lucia: ^2.0.0
|
lucia: ^2.0.0
|
||||||
dependencies:
|
dependencies:
|
||||||
'@prisma/client': 5.1.1(prisma@5.1.1)
|
'@prisma/client': 5.1.1(prisma@5.1.1)
|
||||||
lucia: 2.3.0
|
lucia: 2.4.0
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@lukeed/csprng@1.1.0:
|
/@lukeed/csprng@1.1.0:
|
||||||
|
|
@ -2359,8 +2359,8 @@ packages:
|
||||||
dependencies:
|
dependencies:
|
||||||
reusify: 1.0.4
|
reusify: 1.0.4
|
||||||
|
|
||||||
/feather-icons@4.29.0:
|
/feather-icons@4.29.1:
|
||||||
resolution: {integrity: sha512-Y7VqN9FYb8KdaSF0qD1081HCkm0v4Eq/fpfQYQnubpqi0hXx14k+gF9iqtRys1SIcTEi97xDi/fmsPFZ8xo0GQ==}
|
resolution: {integrity: sha512-P1we61haGTds6lKWe6CCVPsNULb8tHr1y6S9gXEpU+lNR1Ja7GdV0A1l2hTNmzXv+0Stix/3YMWMAn7n1Qtd6A==}
|
||||||
dependencies:
|
dependencies:
|
||||||
classnames: 2.3.2
|
classnames: 2.3.2
|
||||||
core-js: 3.26.1
|
core-js: 3.26.1
|
||||||
|
|
@ -2760,8 +2760,8 @@ packages:
|
||||||
yallist: 4.0.0
|
yallist: 4.0.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/lucia@2.3.0:
|
/lucia@2.4.0:
|
||||||
resolution: {integrity: sha512-FS+WjvTh8xK/N2I5PBQ9xhF5+OJZo1g2w931ZlaJoXSRxsM1WTkMRAyxFAE3Azoe9vHqlKxRsw11ZiSv+yc3rA==}
|
resolution: {integrity: sha512-v2pyFQVF734+EU3m9GeeJQorFR7zLt7JoOJ1UD5ttR5Z+w4IkOyExiXyFe+zssKpony66u94wcxyws3lZSpzzg==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/lucide-svelte@0.256.1(svelte@4.2.0):
|
/lucide-svelte@0.256.1(svelte@4.2.0):
|
||||||
|
|
@ -3992,8 +3992,8 @@ packages:
|
||||||
magic-string: 0.30.0
|
magic-string: 0.30.0
|
||||||
periscopic: 3.1.0
|
periscopic: 3.1.0
|
||||||
|
|
||||||
/sveltekit-flash-message@2.1.3(@sveltejs/kit@1.22.6)(svelte@4.2.0):
|
/sveltekit-flash-message@2.2.0(@sveltejs/kit@1.22.6)(svelte@4.2.0):
|
||||||
resolution: {integrity: sha512-NFhQ3t2101AM9JO5Mgj38r69ykF4BOs1Ap3567DaM1RoAaNtXRXpAuEc/DQV78HZN/Fxzw8dxyTMdIC1HztUvA==}
|
resolution: {integrity: sha512-22hYvD4kQUWJevbiJQkRNIWtEexKyKYhN4zyn8YhfU6J2hRY1uFdTTfH0JIWwPkJ/QarBgLwzP79GO5t/LLZUw==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@sveltejs/kit': 1.x
|
'@sveltejs/kit': 1.x
|
||||||
svelte: 3.x || 4.x
|
svelte: 3.x || 4.x
|
||||||
|
|
@ -4002,8 +4002,8 @@ packages:
|
||||||
svelte: 4.2.0
|
svelte: 4.2.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/sveltekit-superforms@1.5.1(@sveltejs/kit@1.22.6)(svelte@4.2.0)(zod@3.21.4):
|
/sveltekit-superforms@1.6.0(@sveltejs/kit@1.22.6)(svelte@4.2.0)(zod@3.21.4):
|
||||||
resolution: {integrity: sha512-OqKzxuL1P29CFiK1CD00JRsvEsRPedvrR0qXmB4uqzXAIjOS+DpLjoEaa6Cnkd4H00fRa2161GcZNeEBue/D3A==}
|
resolution: {integrity: sha512-Ob3vbgPuVMFuebD8R7qWHDyMVmHvbU6HYqa/ozuV9HbETkkkX7XhyDz/yMxW4q8T2kRiO50CASskiB3l6yKiqA==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@sveltejs/kit': 1.x
|
'@sveltejs/kit': 1.x
|
||||||
svelte: 3.x || 4.x
|
svelte: 3.x || 4.x
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@
|
||||||
<SuperDebug data={$form} />
|
<SuperDebug data={$form} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<form id="search-form" action="/search" method="GET" use:enhance>
|
<form id="search-form" action="/search" method="GET">
|
||||||
<div class="search">
|
<div class="search">
|
||||||
<fieldset class="text-search" aria-busy={submitting} disabled={submitting}>
|
<fieldset class="text-search" aria-busy={submitting} disabled={submitting}>
|
||||||
<Label for="label">Search</Label>
|
<Label for="label">Search</Label>
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,34 @@ export const GET = async ({ url, locals, params, request }) => {
|
||||||
// return error(500, { message: 'Something went wrong' });
|
// return error(500, { message: 'Something went wrong' });
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// let games = await prisma.game.findMany({
|
||||||
|
// where: {
|
||||||
|
// name: {
|
||||||
|
// search: urlQueryParams?.name
|
||||||
|
// },
|
||||||
|
// min_players: {
|
||||||
|
// gte: urlQueryParams?.min_players || 0
|
||||||
|
// },
|
||||||
|
// max_players: {
|
||||||
|
// lte: urlQueryParams?.max_players || 100
|
||||||
|
// },
|
||||||
|
// min_playtime: {
|
||||||
|
// gte: urlQueryParams?.min_playtime || 0
|
||||||
|
// },
|
||||||
|
// max_playtime: {
|
||||||
|
// lte: urlQueryParams?.max_playtime || 5000
|
||||||
|
// },
|
||||||
|
// min_age: {
|
||||||
|
// gte: urlQueryParams?.min_age || 0
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// skip: urlQueryParams?.skip,
|
||||||
|
// take: urlQueryParams?.limit,
|
||||||
|
// orderBy: {
|
||||||
|
// name: 'asc'
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
const searchParams = Object.fromEntries(url.searchParams);
|
const searchParams = Object.fromEntries(url.searchParams);
|
||||||
const q = searchParams?.q || '';
|
const q = searchParams?.q || '';
|
||||||
const limit = parseInt(searchParams?.limit) || 10;
|
const limit = parseInt(searchParams?.limit) || 10;
|
||||||
|
|
@ -56,31 +84,3 @@ export const GET = async ({ url, locals, params, request }) => {
|
||||||
throw error(500, { message: 'Something went wrong' });
|
throw error(500, { message: 'Something went wrong' });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// let games = await prisma.game.findMany({
|
|
||||||
// where: {
|
|
||||||
// name: {
|
|
||||||
// search: urlQueryParams?.name
|
|
||||||
// },
|
|
||||||
// min_players: {
|
|
||||||
// gte: urlQueryParams?.min_players || 0
|
|
||||||
// },
|
|
||||||
// max_players: {
|
|
||||||
// lte: urlQueryParams?.max_players || 100
|
|
||||||
// },
|
|
||||||
// min_playtime: {
|
|
||||||
// gte: urlQueryParams?.min_playtime || 0
|
|
||||||
// },
|
|
||||||
// max_playtime: {
|
|
||||||
// lte: urlQueryParams?.max_playtime || 5000
|
|
||||||
// },
|
|
||||||
// min_age: {
|
|
||||||
// gte: urlQueryParams?.min_age || 0
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// skip: urlQueryParams?.skip,
|
|
||||||
// take: urlQueryParams?.limit,
|
|
||||||
// orderBy: {
|
|
||||||
// name: 'asc'
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
|
||||||
|
|
@ -17,31 +17,35 @@ export const load = async ({ params, setHeaders, locals }) => {
|
||||||
throw error(404, 'not found');
|
throw error(404, 'not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
const wishlist = await prisma.wishlist.findUnique({
|
let wishlist;
|
||||||
where: {
|
let collection;
|
||||||
user_id: user.userId
|
if (user) {
|
||||||
},
|
wishlist = await prisma.wishlist.findUnique({
|
||||||
include: {
|
where: {
|
||||||
items: {
|
user_id: user.userId
|
||||||
where: {
|
},
|
||||||
game_id: game.id
|
include: {
|
||||||
|
items: {
|
||||||
|
where: {
|
||||||
|
game_id: game.id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
|
||||||
const collection = await prisma.collection.findUnique({
|
collection = await prisma.collection.findUnique({
|
||||||
where: {
|
where: {
|
||||||
user_id: user.userId
|
user_id: user.userId
|
||||||
},
|
},
|
||||||
include: {
|
include: {
|
||||||
items: {
|
items: {
|
||||||
where: {
|
where: {
|
||||||
game_id: game.id
|
game_id: game.id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
game,
|
game,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue