mirror of
https://github.com/Hackdex-App/hackdex-website.git
synced 2026-04-25 07:27:47 -05:00
Remove unapproved hacks from sitemap
This commit is contained in:
parent
c7a174fea0
commit
fbe36812b6
|
|
@ -10,9 +10,10 @@ export default async function Sitemap(): Promise<MetadataRoute.Sitemap> {
|
|||
|
||||
const supabase = await createClient();
|
||||
|
||||
const { data: hacks } = await supabase.from("hacks").select("slug,updated_at");
|
||||
const { data: hacks } = await supabase.from("hacks").select("slug,updated_at,approved");
|
||||
if (hacks) {
|
||||
routes.push(...hacks.map((hack) => ({
|
||||
const approvedHacks = hacks.filter((hack) => hack.approved);
|
||||
routes.push(...approvedHacks.map((hack) => ({
|
||||
url: `/hack/${hack.slug}`,
|
||||
changeFrequency: "weekly" as const,
|
||||
lastModified: hack.updated_at || new Date().toISOString(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user