This commit is contained in:
@@ -26,11 +26,18 @@ export async function GET(
|
||||
return NextResponse.json({ error: "Project not found" }, { status: 404 });
|
||||
}
|
||||
|
||||
// Only return shots that have been explicitly shared with the client
|
||||
// Only return shots that have been explicitly shared with the client.
|
||||
// If the session has episode restrictions, further filter to those episodes.
|
||||
const episodeFilter =
|
||||
session.allowedEpisodes && session.allowedEpisodes.length > 0
|
||||
? session.allowedEpisodes
|
||||
: undefined;
|
||||
|
||||
const shots = await db.shot.findMany({
|
||||
where: {
|
||||
projectId: session.projectId,
|
||||
sharedWithClient: true,
|
||||
...(episodeFilter ? { episode: { in: episodeFilter } } : {}),
|
||||
},
|
||||
orderBy: [{ episode: "asc" }, { sequence: "asc" }, { shotCode: "asc" }],
|
||||
select: {
|
||||
|
||||
Reference in New Issue
Block a user