feat: 支持客户查询咨询详情
This commit is contained in:
1 parent
b299c313d1
commit
3186757d93
4 files changed
+46
-1
No files matched your search
@@ -497,6 +497,20 @@ export class CustomerInquirySubmissionController {
|
||||
return submissions.map((submission) => this.present(submission));
|
||||
}
|
||||
|
||||
@Get(":id")
|
||||
async get(@Req() request: FastifyRequest, @Param("id") id: string): Promise<unknown> {
|
||||
const identity = this.identity(request);
|
||||
const submission = await this.prisma.inquirySubmission.findFirst({
|
||||
where: { id, brandId: identity.brandId, customerSubject: identity.subject },
|
||||
include: {
|
||||
inquiryForm: { select: { name: true, purpose: true } },
|
||||
offering: { select: { id: true, name: true } },
|
||||
},
|
||||
});
|
||||
if (!submission) throw new NotFoundException("咨询记录不存在");
|
||||
return this.present(submission);
|
||||
}
|
||||
|
||||
@Post()
|
||||
async create(
|
||||
@Req() request: FastifyRequest,
|
||||
|
||||
Reference in new issue
Block a user