From d1d654ebac2d51e3841675faeb56480e440f622f Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Tue, 5 Mar 2024 18:08:09 +0100 Subject: Initial commit --- frontend/src/routes/artists/+page.svelte | 101 +++++++++++++++++++++++++++++++ frontend/src/routes/artists/+page.ts | 12 ++++ 2 files changed, 113 insertions(+) create mode 100644 frontend/src/routes/artists/+page.svelte create mode 100644 frontend/src/routes/artists/+page.ts (limited to 'frontend/src/routes/artists') diff --git a/frontend/src/routes/artists/+page.svelte b/frontend/src/routes/artists/+page.svelte new file mode 100644 index 0000000..e07338c --- /dev/null +++ b/frontend/src/routes/artists/+page.svelte @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + openModal(AddArtist)} /> + + + {#if artists} + +
+ + {#each artists.edges as { id, name }, index (id)} + + + + + + {:else} + + {/each} + +
+ + {:else} + + {/if} +
diff --git a/frontend/src/routes/artists/+page.ts b/frontend/src/routes/artists/+page.ts new file mode 100644 index 0000000..5a76550 --- /dev/null +++ b/frontend/src/routes/artists/+page.ts @@ -0,0 +1,12 @@ +import { ArtistSort, type ArtistFilterInput } from '$gql/graphql'; +import { parseFilter, parsePaginationData, parseSortData } from '$lib/Navigation'; + +export const trailingSlash = 'always'; + +export function load({ url }: { url: URL; params: Record }) { + return { + sort: parseSortData(url.searchParams, ArtistSort.Name), + filter: parseFilter(url.searchParams), + pagination: parsePaginationData(url.searchParams) + }; +} -- cgit v1.2.3-2-gb3c3