chore: Redirect to landing page if org not found (#235)

* Update +page.svelte

* add redirect route
This commit is contained in:
Rotimi Best
2024-04-02 07:02:24 +01:00
committed by GitHub
parent 23b3b5f555
commit 41462b8889
2 changed files with 14 additions and 1 deletions
+9 -1
View File
@@ -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')
}
</script>
<div
@@ -27,7 +35,7 @@
the meantime, here's a joke to make you laugh:<br />
What do you call a fish with no eyes? Fsh!
</p>
<PrimaryButton label="Go to Home" className="rounded-md" onClick={() => goto('/')} />
<PrimaryButton label="Go to Home" className="rounded-md" onClick={handleClick} />
</div>
<img src="/classroom-404.png" alt="classroomio_error_image" class="errorImg" />
@@ -0,0 +1,5 @@
import { redirect } from '@sveltejs/kit';
export const load = () => {
throw redirect(307, 'https://classroomio.com');
};