REST Queries for localised fields (NextJS staticPaths & staticProps) #362
-
tldr:REST Queries such as Description:I'm trying to make dynamic localised slugs work for a static web with Payload and Next.js For example Since I want localised dynamic slugs, I'm using
In Payload I got this field
The Payload REST Queries only works for the defaultLocale
This gives me no possibility to get the data I need in Next.js since I hope I have explained this well enough. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I believe I have solved it myself. See below.
|
Beta Was this translation helpful? Give feedback.
I believe I have solved it myself. See below.
Was pretty sure I double checked this like 10 times before submitting this, guess not 😩
http://localhost:3001/api/pages?where[slug][equals]=home
<-- workshttp://localhost:3001/api/pages?where[slug][equals]=hem
<-- doesn't workhttp://localhost:3001/api/pages?where[slug][equals]=hem&locale=sv
<-- works