Skip to content

Commit

Permalink
flatpages will use forward slashes around id
Browse files Browse the repository at this point in the history
  • Loading branch information
rtrembecky committed Nov 23, 2024
1 parent e1f681e commit 346ae8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/strom/[page].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const seminarBasedGetServerSideProps =
if (query?.page && typeof query.page === 'string') {
const requestedUrl = query.page
const {data} = await axios.get<FlatPage | undefined>(
`${process.env.NEXT_PUBLIC_BE_PROTOCOL}://${process.env.NEXT_PUBLIC_BE_HOSTNAME}:${process.env.NEXT_PUBLIC_BE_PORT}/base/flat-page/by-url/${requestedUrl}`,
`${process.env.NEXT_PUBLIC_BE_PROTOCOL}://${process.env.NEXT_PUBLIC_BE_HOSTNAME}:${process.env.NEXT_PUBLIC_BE_PORT}/base/flat-page/by-url/${encodeURIComponent(`/${requestedUrl}/`)}`,
)
// ked stranka neexistuje, vrati sa `content: ""`. teraz renderujeme stranku len ked je content neprazdny a server rovno vrati redirect.
// druha moznost by bola nechat prazdny content handlovat clienta - napriklad zobrazit custom error, ale nechat usera na neplatnej stranke.
Expand Down

0 comments on commit 346ae8d

Please sign in to comment.