summaryrefslogtreecommitdiff
path: root/src/lib/redirect_to.ts
blob: e31e2354d059f2a84191d079a894b97a191f3f25 (plain)
1
2
3
4
5
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;
}