Skip to content

Commit

Permalink
add redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
jsladerman committed Nov 25, 2024
1 parent c13ba56 commit 6f9cde4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
3 changes: 1 addition & 2 deletions app/api/newsletter/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ async function setEmail(email) {
}

if (body?.category === 'CONFLICT') {
const contactId = body.message?.match(/Existing ID:\s*(?<id>\d+)/)
?.groups?.id
const contactId = body.message?.match(/Existing ID:\s*(\d+)/)?.[1]

if (!contactId) {
return false
Expand Down
17 changes: 17 additions & 0 deletions pages/kubernetes/[...slug].tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { type GetServerSideProps } from 'next'

export const getServerSideProps: GetServerSideProps = async ({ params }) => {
const slug = params?.slug as string[]
const newPath = `/${slug.join('/')}`

return {
redirect: {
destination: newPath,
permanent: true,
},
}
}

export default function KubernetesRedirect() {
return null
}

0 comments on commit 6f9cde4

Please sign in to comment.