added custom grouping on project pages
Deploy / deploy (push) Successful in 2m26s

This commit is contained in:
twotalesanimation
2026-05-20 22:43:29 +02:00
parent de59bbc0aa
commit d39b968dcb
7 changed files with 139 additions and 5 deletions
+9
View File
@@ -18,6 +18,7 @@ const createShotSchema = z.object({
frameEnd: z.number().int().optional(),
dueDate: z.string().optional(),
thumbnailUrl: z.string().optional(),
shotGroupName: z.string().max(100).optional(),
});
export async function createShot(data: z.infer<typeof createShotSchema>) {
@@ -83,6 +84,13 @@ export async function createShot(data: z.infer<typeof createShotSchema>) {
frameEnd: parsed.frameEnd,
dueDate: parsed.dueDate ? new Date(parsed.dueDate) : undefined,
thumbnailUrl: parsed.thumbnailUrl,
shotGroupId: parsed.shotGroupName?.trim()
? (await db.shotGroup.upsert({
where: { projectId_name: { projectId: parsed.projectId, name: parsed.shotGroupName.trim() } },
create: { projectId: parsed.projectId, name: parsed.shotGroupName.trim() },
update: {},
})).id
: undefined,
},
});
@@ -162,6 +170,7 @@ export async function duplicateShot(sourceShotId: string) {
frameEnd: source.frameEnd,
dueDate: source.dueDate,
thumbnailUrl: source.thumbnailUrl,
shotGroupId: source.shotGroupId ?? undefined,
// Duplicate tasks — reset status and schedule fields
tasks: {
create: source.tasks.map((t) => ({