fix: 拦截禁用业务的过期提交

This commit is contained in:
que01 committed 2026-09-22 11:54:39 +08:00
1 parent 7821c0c98c
commit 4afb6bbbe8
2 files changed
+16 -1

No files matched your search

+7 -1
View File
@@ -220,6 +220,7 @@ export class PublicInquiryFormController {
id,
brandId: process.env.DEFAULT_BRAND_ID ?? "00000000-0000-0000-0000-000000000001",
isEnabled: true,
OR: [{ offeringId: null }, { offering: { isEnabled: true } }],
},
});
if (!form) throw new BadRequestException("咨询表单不存在");
@@ -245,7 +246,12 @@ export class CustomerInquirySubmissionController {
}
if (identity.role !== "customer") throw new ForbiddenException("无客户权限");
const form = await this.prisma.inquiryForm.findFirst({
where: { id: body.formId, brandId: identity.brandId, isEnabled: true },
where: {
id: body.formId,
brandId: identity.brandId,
isEnabled: true,
OR: [{ offeringId: null }, { offering: { isEnabled: true } }],
},
});
if (!form) throw new BadRequestException("咨询表单不存在");
return this.prisma.inquirySubmission.create({