refactor: Add explicit types for workspace and project member checks

This commit is contained in:
Yusuf İpek
2026-02-07 17:28:46 +03:00
parent d01c2247b5
commit 49c3ac61ea
7 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ export async function GET(request: NextRequest, { params }: RouteParams) {
// Check access
const isPublic = project.visibility === ProjectVisibility.PUBLIC;
const isOwner = session?.user?.id === project.ownerId;
const isMember = project.members.some(m => m.userId === session?.user?.id);
const isMember = project.members.some((m: { userId: string }) => m.userId === session?.user?.id);
// Check workspace membership
let isWorkspaceMember = false;
@@ -106,7 +106,7 @@ export async function POST(request: NextRequest, { params }: RouteParams) {
const nextVersionNumber = (video.versions[0]?.versionNumber || 0) + 1;
// Use transaction to handle active flag
const version = await db.$transaction(async (tx) => {
const version = await db.$transaction(async (tx: Parameters<Parameters<typeof db.$transaction>[0]>[0]) => {
// If setActive, deactivate all other versions
if (setActive) {
await tx.videoVersion.updateMany({