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:
Keisuke Nagakawa 2024-06-17 17:17:57 +09:00 committed by GitHub
parent cbbe586f2f
commit cf754976e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,
}))
}