We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a8018dd commit a07d6ebCopy full SHA for a07d6eb
src/app/notes/page.tsx
@@ -1,5 +1,6 @@
1
import type { NoteWrappedPayload } from '@mx-space/api-client'
2
3
+import { NotFound404 } from '~/components/common/404'
4
import { apiClient } from '~/lib/request'
5
6
import Redirect from './redirect'
@@ -11,7 +12,14 @@ export default async function Page() {
11
12
next: {
13
revalidate: 30,
14
},
- }).then((res) => res.json() as Promise<NoteWrappedPayload>)
15
+ })
16
+ .then((res) => res.json() as Promise<NoteWrappedPayload>)
17
+ .catch(() => {
18
+ return null
19
20
21
+ if (!data || !data.data) {
22
+ return <NotFound404 />
23
+ }
24
return <Redirect nid={data.data?.nid} />
25
}
0 commit comments