fix: use createdAt instead of updatedAt for hardware in sitemap

This commit is contained in:
2026-04-27 16:07:39 +08:00
parent 713b309f74
commit a6eb50a555
+2 -2
View File
@@ -7,7 +7,7 @@ const BASE_URL = "https://deckyvault.xyz"
export default async function sitemap(): Promise<MetadataRoute.Sitemap> { export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const [allGames, allDevices] = await Promise.all([ const [allGames, allDevices] = await Promise.all([
db.select({ id: games.id, updatedAt: games.updatedAt }).from(games), db.select({ id: games.id, updatedAt: games.updatedAt }).from(games),
db.select({ slug: hardware.slug, updatedAt: hardware.updatedAt }).from(hardware), db.select({ slug: hardware.slug, createdAt: hardware.createdAt }).from(hardware),
]) ])
const gameEntries: MetadataRoute.Sitemap = allGames.map((game) => ({ const gameEntries: MetadataRoute.Sitemap = allGames.map((game) => ({
@@ -19,7 +19,7 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const deviceEntries: MetadataRoute.Sitemap = allDevices.map((device) => ({ const deviceEntries: MetadataRoute.Sitemap = allDevices.map((device) => ({
url: `${BASE_URL}/devices/${device.slug}`, url: `${BASE_URL}/devices/${device.slug}`,
lastModified: device.updatedAt, lastModified: device.createdAt,
changeFrequency: "monthly", changeFrequency: "monthly",
priority: 0.6, priority: 0.6,
})) }))