Adding separate button for wishlist and pagination store.

This commit is contained in:
Bradley Shellnut 2023-08-19 18:18:21 -07:00
parent 714cdca2e4
commit e086274735
3 changed files with 52 additions and 0 deletions

View file

@ -0,0 +1,9 @@
<script lang="ts">
import Button from "./ui/button/Button.svelte";
</script>
<Button type="submit">Add to wishlist</Button>
<style lang="postcss">
</style>

View file

@ -0,0 +1,15 @@
import { writable } from 'svelte/store';
// Custom store
const state = () => {
const initial = 1;
const { subscribe, set, update } = writable(initial);
function clear() {
set(initial);
}
return { subscribe, set, update, clear };
};
export const pagination = state();

View file

@ -56,3 +56,31 @@ export const GET = async ({ url, locals, params, request }) => {
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'
// }
// });