Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshinorin committed Jan 2, 2024
1 parent 63a025a commit 53caa03
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/app/[...slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use server';

import { permanentRedirect } from "next/navigation";

import { ContentResponse, Content } from '../../models/content';
import { findByPath } from '../../api/content';
import { asInsight } from '../../utils/converters';
Expand All @@ -21,12 +23,8 @@ async function get(req: any) {
if (!path.endsWith("/")) {
path = `${path}/`
}
return {
redirect: {
permanent: true,
destination: `/articles${path}`
}
}
// https://nextjs.org/docs/app/api-reference/functions/permanentRedirect
return permanentRedirect(`/articles${path}`);
}

const response: Response = await findByPath(path);
Expand Down

0 comments on commit 53caa03

Please sign in to comment.