0.0.8.0
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user