mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
Adding separate button for wishlist and pagination store.
This commit is contained in:
parent
714cdca2e4
commit
e086274735
3 changed files with 52 additions and 0 deletions
|
|
@ -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>
|
||||||
15
src/lib/stores/paginationStore.ts
Normal file
15
src/lib/stores/paginationStore.ts
Normal 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();
|
||||||
|
|
@ -56,3 +56,31 @@ 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'
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue