This commit is contained in:
freedakgmail
2025-11-23 18:03:04 +08:00
parent 9cdd751a56
commit e44dd0bd95
489 changed files with 264491 additions and 4157 deletions
+2 -2
View File
@@ -19,8 +19,8 @@ export async function POST(
const { treeId } = await params
// 检查权限(需要 OWNER 权限)
const { hasPermission } = await checkPermission(session.user.id, treeId, Role.OWNER)
// 检查权限(需要 EDITOR 权限)
const { hasPermission } = await checkPermission(session.user.id, treeId, Role.EDITOR)
if (!hasPermission) {
return NextResponse.json({ error: "无权限导入数据" }, { status: 403 })
}
+3 -2
View File
@@ -8,8 +8,9 @@ import { RelationshipCalculator } from '@/lib/relationship-calculator'
*/
export async function GET(
request: NextRequest,
{ params }: { params: { treeId: string } }
{ params }: { params: Promise<{ treeId: string }> }
) {
const { treeId } = await params
try {
const { searchParams } = new URL(request.url)
const fromId = searchParams.get('from')
@@ -24,7 +25,7 @@ export async function GET(
// 获取家族树的所有成员
const members = await prisma.familyMember.findMany({
where: { treeId: params.treeId }
where: { treeId }
})
if (members.length === 0) {