feat: 在业务提供项公开详情中关联咨询表单
This commit is contained in:
1 parent
c907734076
commit
888a504423
2 files changed
+20
No files matched your search
@@ -170,6 +170,13 @@ export class PublicOfferingController {
|
||||
const items = await this.prisma.offering.findMany({
|
||||
where: { brandId, isEnabled: true },
|
||||
orderBy: { sortOrder: "asc" },
|
||||
include: {
|
||||
inquiryForms: {
|
||||
where: { isEnabled: true },
|
||||
orderBy: { updatedAt: "desc" },
|
||||
select: { id: true, name: true, purpose: true, targetType: true, version: true },
|
||||
},
|
||||
},
|
||||
});
|
||||
return items.map((item) => this.present(item));
|
||||
}
|
||||
@@ -181,6 +188,13 @@ export class PublicOfferingController {
|
||||
brandId: process.env.DEFAULT_BRAND_ID ?? "00000000-0000-0000-0000-000000000001",
|
||||
isEnabled: true,
|
||||
},
|
||||
include: {
|
||||
inquiryForms: {
|
||||
where: { isEnabled: true },
|
||||
orderBy: { updatedAt: "desc" },
|
||||
select: { id: true, name: true, purpose: true, targetType: true, version: true },
|
||||
},
|
||||
},
|
||||
});
|
||||
if (!item) throw new BadRequestException("业务提供项不存在");
|
||||
return this.present(item);
|
||||
|
||||
Reference in new issue
Block a user