refactor: 统一模板契约并修复预览版本
This commit is contained in:
1 parent
cd2992c00a
commit
50b87e48de
56 files changed
+7849
-5756
No files matched your search
@@ -60,10 +60,6 @@ export class AdminConfigController {
|
||||
@Body() body: UpdateBrandDto,
|
||||
): Promise<unknown> {
|
||||
this.requireAdmin(request);
|
||||
const { config } = body;
|
||||
if (config?.visualTemplateKey !== undefined) {
|
||||
await this.access.requireRole(request, ["owner", "admin", "platform-admin"]);
|
||||
}
|
||||
return this.brandConfig.updateBrand(this.brandId(request), body);
|
||||
}
|
||||
@Patch("presentation")
|
||||
@@ -75,21 +71,6 @@ export class AdminConfigController {
|
||||
const brandId = this.brandId(request);
|
||||
return this.brandConfig.updatePresentation(brandId, body);
|
||||
}
|
||||
@Get("visual-template/history")
|
||||
getVisualTemplateHistory(@Req() request: FastifyRequest): unknown {
|
||||
this.requireAdmin(request);
|
||||
return this.brandConfig.visualTemplateHistory(this.brandId(request));
|
||||
}
|
||||
@Post("visual-template/rollback")
|
||||
async rollbackVisualTemplate(@Req() request: FastifyRequest): Promise<unknown> {
|
||||
this.requireAdmin(request);
|
||||
return this.brandConfig.rollbackVisualTemplate(this.brandId(request));
|
||||
}
|
||||
@Get("visual-template/preview")
|
||||
getVisualTemplatePreview(@Req() request: FastifyRequest): unknown {
|
||||
this.requireAdmin(request);
|
||||
return this.brandConfig.visualTemplatePreview(this.brandId(request));
|
||||
}
|
||||
@Get("trust-content")
|
||||
listTrustContent(@Req() request: FastifyRequest): Promise<unknown> {
|
||||
this.requireAdmin(request);
|
||||
|
||||
Reference in new issue
Block a user