I have a page it structure is the following : /read/[slug]/[number]
I want to get the slug value that corresponds each number in the getStaticPaths
This is the code :
export async function getStaticPaths() {
const slugs = await client.fetch(
`*[_type == "comic" && defined(slug.current)][].slug.current`
)
const paths = await client.fetch(
`*[_type == "comic"][].chapters[].number`
)
return {
paths: paths.map((number : any) => ({params: {number: number, slug: "test"}})),
fallback: false,
}
}
the slugs variable is the array that contains all the slug values.
instead of test in the params slug value , I want to get it corresponding value of number , how I can possible manipulate this code to solve it ?