Files
probably-rendering-one-more…/apps/waterfall-wiki/src/pages/p/[slug].tsx
T
codex-bot ad398db781
waterfall-wiki CI and deployment / verify-and-deploy (push) Has been cancelled
studio CI and deployment / verify-and-deploy (push) Successful in 9m15s
Restore PROMPT branding, rename waterfall-wiki, and add system tag workflows
2026-10-27 00:35:59 +08:00

6 lines
482 B
TypeScript

import type {GetServerSideProps} from 'next';
import {publicPostId} from '@/lib/model';
import {getPost} from '@/lib/library';
export default function LegacyPost(){return null;}
export const getServerSideProps:GetServerSideProps=async({params,query})=>{const post=await getPost(String(params?.slug||''));return post?{redirect:{destination:'/explore/'+publicPostId(post)+(String(query.agent_mode||'').toLowerCase()==='true'?'?agent_mode=True':''),permanent:true}}:{notFound:true};};