diff options
| author | Adam Soltys <[email protected]> | 2023-01-06 22:56:52 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-01-06 22:56:52 -0800 |
| commit | 9809520d30af802596d87686c59a2e5d53778dcc (patch) | |
| tree | 60849fc87c94a4c595e1ea95bc22a81ad6fe3d63 /src/routes | |
| parent | 8bbcfc3534feceb5fb5756ba29613ab327e7ea5c (diff) | |
| download | coinos-ui-9809520d30af802596d87686c59a2e5d53778dcc.tar.gz coinos-ui-9809520d30af802596d87686c59a2e5d53778dcc.zip | |
event route and reaction ui
Diffstat (limited to 'src/routes')
| -rw-r--r-- | src/routes/(app)/[username]/(profile)/event/[id]/+page.server.js | 13 | ||||
| -rw-r--r-- | src/routes/(app)/[username]/(profile)/event/[id]/+page.svelte | 7 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/routes/(app)/[username]/(profile)/event/[id]/+page.server.js b/src/routes/(app)/[username]/(profile)/event/[id]/+page.server.js new file mode 100644 index 00000000..f31b4902 --- /dev/null +++ b/src/routes/(app)/[username]/(profile)/event/[id]/+page.server.js @@ -0,0 +1,13 @@ +import { get } from '$lib/utils'; +import { error } from '@sveltejs/kit'; + +export async function load({ params: { id } }) { + try { + let event = await get(`/event/${id}`); + if (!event) throw error(500, 'Event not found'); + return { event }; + } catch (e) { + throw error(500, e.message); + } + +} diff --git a/src/routes/(app)/[username]/(profile)/event/[id]/+page.svelte b/src/routes/(app)/[username]/(profile)/event/[id]/+page.svelte new file mode 100644 index 00000000..1347947f --- /dev/null +++ b/src/routes/(app)/[username]/(profile)/event/[id]/+page.svelte @@ -0,0 +1,7 @@ +<script> + import { Event } from "$comp"; + export let data; + let { event } = data; +</script> + +<Event {event} /> |
