Update sitemap.mdx (#66950)
Fix: Correct URL generation in sitemap to use product.id - Updated sitemap function to correctly use product.id for URL generation instead of id. - Ensured each product's URL is accurately reflected in the sitemap output.
This commit is contained in:
parent
cbbe586f2f
commit
cf754976e5
1 changed files with 2 additions and 2 deletions
|
@ -236,7 +236,7 @@ export default async function sitemap({
|
|||
`SELECT id, date FROM products WHERE id BETWEEN ${start} AND ${end}`
|
||||
)
|
||||
return products.map((product) => ({
|
||||
url: `${BASE_URL}/product/${id}`,
|
||||
url: `${BASE_URL}/product/${product.id}`,
|
||||
lastModified: product.date,
|
||||
}))
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ export default async function sitemap({ id }) {
|
|||
`SELECT id, date FROM products WHERE id BETWEEN ${start} AND ${end}`
|
||||
)
|
||||
return products.map((product) => ({
|
||||
url: `${BASE_URL}/product/${id}`,
|
||||
url: `${BASE_URL}/product/${product.id}`,
|
||||
lastModified: product.date,
|
||||
}))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue