feat: 增加品牌通用扩展配置

This commit is contained in:
que01 committed 2026-09-21 14:10:25 +08:00
1 parent 270136d24e
commit 73e21e6b0d
5 files changed
+22 -1

No files matched your search

+1
View File
@@ -23,6 +23,7 @@ export class UpdateBrandDto {
@IsOptional() @IsString() deliveryNote?: string;
@IsOptional() @IsString() contactPhone?: string;
@IsOptional() @IsString() contactWechat?: string;
@IsOptional() @IsObject() config?: Record<string, unknown>;
}
export class UpdateServiceDto {
+8 -1
View File
@@ -465,7 +465,14 @@ export class AdminConfigController {
@Patch("brand")
updateBrand(@Req() request: FastifyRequest, @Body() body: UpdateBrandDto): Promise<unknown> {
this.requireAdmin(request);
return this.prisma.brandProfile.update({ where: { id: this.brandId() }, data: body });
const { config, ...fields } = body;
return this.prisma.brandProfile.update({
where: { id: this.brandId() },
data: {
...fields,
...(config ? { config: config as Prisma.InputJsonValue } : {}),
},
});
}
@Get("trust-content")
listTrustContent(@Req() request: FastifyRequest): Promise<unknown> {