Merged in feature/SW-2320-languagebased-hide-for-next-release (pull request #1937)
Language based alternative to HIDE_FOR_NEXT_RELEASE Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -12,8 +12,8 @@ export async function GET(
|
||||
_request: NextRequest,
|
||||
context: { params: { sitemapId: string } }
|
||||
) {
|
||||
if (env.HIDE_FOR_NEXT_RELEASE) {
|
||||
notFound()
|
||||
if (env.NEW_SITE_LIVE_STATUS !== "ALL_LANGUAGES_LIVE") {
|
||||
return notFound()
|
||||
}
|
||||
|
||||
const sitemapId = context.params.sitemapId
|
||||
@@ -21,12 +21,12 @@ export async function GET(
|
||||
console.log("[SITEMAP] Fetching sitemap by ID", sitemapId)
|
||||
|
||||
if (!sitemapId) {
|
||||
notFound()
|
||||
return notFound()
|
||||
}
|
||||
|
||||
const sitemapData = await getSitemapDataById(Number(sitemapId))
|
||||
if (!sitemapData.length) {
|
||||
notFound()
|
||||
return notFound()
|
||||
}
|
||||
|
||||
const entries = sitemapData.map((entry) => {
|
||||
|
||||
@@ -7,8 +7,8 @@ import { getLastUpdated, getSitemapIds } from "@/utils/sitemap"
|
||||
export const dynamic = "force-dynamic"
|
||||
|
||||
export async function GET() {
|
||||
if (env.HIDE_FOR_NEXT_RELEASE) {
|
||||
notFound()
|
||||
if (env.NEW_SITE_LIVE_STATUS !== "ALL_LANGUAGES_LIVE") {
|
||||
return notFound()
|
||||
}
|
||||
|
||||
console.log(`[SITEMAP] Fetching sitemap`)
|
||||
|
||||
Reference in New Issue
Block a user