Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coda configurable redirects #357

Merged
merged 2 commits into from
Feb 5, 2024
Merged

Coda configurable redirects #357

merged 2 commits into from
Feb 5, 2024

Conversation

mruwnik
Copy link
Collaborator

@mruwnik mruwnik commented Feb 4, 2024

Maps redirects from Coda

@mruwnik mruwnik requested a review from Aprillion February 4, 2024 19:50
Aprillion
Aprillion previously approved these changes Feb 4, 2024
}

const RenderUI = () => {
// This should never be called, but is required for Remix to treat it as an UI route
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

try {
const {data: redirects} = await loadRedirects(request)
const to = params['*'] && redirects[params['*'].replace(/^\/+/, '')]
if (to) return redirect(to.replace(/^\/+/, '/'))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move this replace to loadRedirects? (so both Coda fields are fixed there and this function will be responsible only for request)

@mruwnik mruwnik merged commit 2c45713 into master Feb 5, 2024
1 check passed
@mruwnik mruwnik deleted the redirects branch February 5, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants