0.0.1.1
This commit is contained in:
@@ -16,7 +16,6 @@ export async function GET(
|
||||
}
|
||||
|
||||
const { treeId } = await params
|
||||
console.log('API /trees/[treeId] - Requested treeId:', treeId)
|
||||
|
||||
const tree = await prisma.familyTree.findFirst({
|
||||
where: {
|
||||
@@ -50,11 +49,9 @@ export async function GET(
|
||||
})
|
||||
|
||||
if (!tree) {
|
||||
console.log('API /trees/[treeId] - Tree not found for id:', treeId)
|
||||
return NextResponse.json({ error: "家族树不存在或无权访问" }, { status: 404 })
|
||||
}
|
||||
|
||||
console.log('API /trees/[treeId] - Returning tree:', tree.name, tree.id)
|
||||
return NextResponse.json({ tree })
|
||||
} catch (error) {
|
||||
console.error("获取家族树失败:", error)
|
||||
|
||||
+1
-4
@@ -29,13 +29,10 @@ interface ActivityLog {
|
||||
}
|
||||
|
||||
export default function DashboardPage() {
|
||||
const { treeData, currentTree, isLoading } = useFamily()
|
||||
const { treeData, isLoading, currentTree } = useFamily()
|
||||
const { data: session } = useSession()
|
||||
const [recentActivities, setRecentActivities] = useState<ActivityLog[]>([])
|
||||
|
||||
// 调试日志
|
||||
console.log('Dashboard - treeData:', treeData, 'currentTree:', currentTree?.name, 'isLoading:', isLoading)
|
||||
|
||||
// 加载最近的操作日志
|
||||
useEffect(() => {
|
||||
if (currentTree?.id && session?.user?.id) {
|
||||
|
||||
Reference in New Issue
Block a user