Skip to content

Commit

Permalink
feat(nuxt-ripple): ✨ implement 301 redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
waitingallday committed Jul 14, 2023
1 parent 5df65a0 commit 97da41c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/nuxt-ripple/composables/use-tide-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ export const useTidePage = async (
if (error && error.value?.statusCode) {
useTideError(error.value?.statusCode)
}

// 301 redirect
if (data.value.type === 'redirect' && data.value.status_code === '301') {
useRouter().replace(data.value.redirect_url)
}

return data.value
}

Expand Down

0 comments on commit 97da41c

Please sign in to comment.