mirror of
https://github.com/vercel/commerce.git
synced 2025-05-08 10:47:51 +00:00
fixed sitemap
This commit is contained in:
parent
83856a4941
commit
40e8b79c44
@ -36,17 +36,18 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||
}))
|
||||
);
|
||||
|
||||
const pagesPromise = getPages().then((pages) =>
|
||||
pages.map((page) => ({
|
||||
url: `${baseUrl}/${page.handle}`,
|
||||
lastModified: page.updatedAt
|
||||
}))
|
||||
);
|
||||
const pages = getPages().map((page) => ({
|
||||
url: `${baseUrl}/${page.handle}`,
|
||||
lastModified: page.updatedAt
|
||||
}));
|
||||
|
||||
let fetchedRoutes: Route[] = [];
|
||||
|
||||
try {
|
||||
fetchedRoutes = (await Promise.all([collectionsPromise, productsPromise, pagesPromise])).flat();
|
||||
fetchedRoutes = [
|
||||
...(await Promise.all([collectionsPromise, productsPromise])).flat(),
|
||||
...pages
|
||||
];
|
||||
} catch (error) {
|
||||
throw JSON.stringify(error, null, 2);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user