refactor: list also include relation

This commit is contained in:
Methapon Metanipat 2024-10-24 13:25:23 +07:00
parent 438582054f
commit 399959f0b1

View file

@ -24,7 +24,12 @@ export class FlowTemplateController extends Controller {
return await prisma.workflowTemplate.findMany({
include: {
step: {
include: { value: true },
include: {
value: true,
responsiblePerson: {
include: { user: true },
},
},
},
},
orderBy: { createdAt: "asc" },
@ -38,7 +43,12 @@ export class FlowTemplateController extends Controller {
return await prisma.workflowTemplate.findFirst({
include: {
step: {
include: { value: true },
include: {
value: true,
responsiblePerson: {
include: { user: true },
},
},
},
},
where: { id: templateId },