diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/redirect_to.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/redirect_to.ts b/src/lib/redirect_to.ts new file mode 100644 index 0000000..e31e235 --- /dev/null +++ b/src/lib/redirect_to.ts @@ -0,0 +1,6 @@ +export default function redirectTo(route: string) { + const split_location = window.location.href.split('/') + const hostname = split_location.slice(0, split_location.length - 1).join('/'); + + window.location.href = hostname + route; +}
\ No newline at end of file |