From 41462b8889b05a548e0e3f7162f8243ceb353249 Mon Sep 17 00:00:00 2001
From: Rotimi Best
Date: Tue, 2 Apr 2024 07:02:24 +0100
Subject: [PATCH] chore: Redirect to landing page if org not found (#235)
* Update +page.svelte
* add redirect route
---
apps/dashboard/src/routes/404/+page.svelte | 10 +++++++++-
apps/dashboard/src/routes/home/+page.server.ts | 5 +++++
2 files changed, 14 insertions(+), 1 deletion(-)
create mode 100644 apps/dashboard/src/routes/home/+page.server.ts
diff --git a/apps/dashboard/src/routes/404/+page.svelte b/apps/dashboard/src/routes/404/+page.svelte
index 4b111227..d67b1552 100644
--- a/apps/dashboard/src/routes/404/+page.svelte
+++ b/apps/dashboard/src/routes/404/+page.svelte
@@ -8,6 +8,14 @@
const src = './bg-404.png';
let query = new URLSearchParams($page.url.search);
let isOrg = query.get('type') === 'org';
+
+ function handleClick() {
+ if (!isOrg) {
+ return goto('/')
+ }
+
+ return goto('/home')
+ }
What do you call a fish with no eyes? Fsh!
- goto('/')} />
+
diff --git a/apps/dashboard/src/routes/home/+page.server.ts b/apps/dashboard/src/routes/home/+page.server.ts
new file mode 100644
index 00000000..ed0a0415
--- /dev/null
+++ b/apps/dashboard/src/routes/home/+page.server.ts
@@ -0,0 +1,5 @@
+import { redirect } from '@sveltejs/kit';
+
+export const load = () => {
+ throw redirect(307, 'https://classroomio.com');
+};