feat(explore): 添加文件夹详情页面
- 修复 folder-aciton.ts 文件名拼写错误为 folder-action.ts - 修复所有导入路径中的拼写错误 - 添加 repoGetPublicFolderById 和 actionGetPublicFolderById - 创建 ExploreDetailClient 详情页组件 - /explore/[id] 现在显示文件夹详情和链接到 /folders/[id] - 添加 exploreDetail 中英文翻译
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import { InFolder } from "@/app/folders/[folder_id]/InFolder";
|
||||
import { actionGetFolderVisibility } from "@/modules/folder/folder-aciton";
|
||||
import { ExploreDetailClient } from "./ExploreDetailClient";
|
||||
import { actionGetPublicFolderById } from "@/modules/folder/folder-action";
|
||||
|
||||
export default async function ExploreFolderPage({
|
||||
params,
|
||||
@@ -13,17 +13,11 @@ export default async function ExploreFolderPage({
|
||||
redirect("/explore");
|
||||
}
|
||||
|
||||
const folderInfo = (await actionGetFolderVisibility(Number(id))).data;
|
||||
const result = await actionGetPublicFolderById(Number(id));
|
||||
|
||||
if (!folderInfo) {
|
||||
if (!result.success || !result.data) {
|
||||
redirect("/explore");
|
||||
}
|
||||
|
||||
const isPublic = folderInfo.visibility === "PUBLIC";
|
||||
|
||||
if (!isPublic) {
|
||||
redirect("/explore");
|
||||
}
|
||||
|
||||
return <InFolder folderId={Number(id)} isReadOnly={true} />;
|
||||
return <ExploreDetailClient folder={result.data} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user