feat: 增加品牌通用扩展配置
This commit is contained in:
1 parent
270136d24e
commit
73e21e6b0d
5 files changed
+22
-1
No files matched your search
@@ -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 {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
Reference in new issue
Block a user