refactor: 退役运行时视觉模块并泛化模板门禁
This commit is contained in:
1 parent
25d1fe983c
commit
e2e2340bfe
56 files changed
+290
-1037
No files matched your search
@@ -702,26 +702,6 @@ async function ensureRuntimeContent(brandId: string, template: RuntimeSeedTempla
|
||||
data: { isEnabled: false },
|
||||
});
|
||||
}
|
||||
const moduleDefinitions = [
|
||||
["founder-card", "主理人介绍"],
|
||||
["brand-hero", "品牌首屏"],
|
||||
["trust-proof", "信任与案例"],
|
||||
["offering-list", "业务提供项"],
|
||||
["inquiry", "咨询入口"],
|
||||
] as const;
|
||||
for (const [sortOrder, [type, title]] of moduleDefinitions.entries()) {
|
||||
const existing = await prisma.brandModule.findFirst({ where: { brandId, type } });
|
||||
if (existing) {
|
||||
await prisma.brandModule.update({
|
||||
where: { id: existing.id },
|
||||
data: { isEnabled: true, sortOrder, title },
|
||||
});
|
||||
} else {
|
||||
await prisma.brandModule.create({
|
||||
data: { brandId, type, title, sortOrder, source: "seed", isEnabled: true },
|
||||
});
|
||||
}
|
||||
}
|
||||
const incompleteOfferings = await prisma.offering.findMany({
|
||||
where: { brandId, isEnabled: true, coverUrl: null },
|
||||
select: { id: true, name: true },
|
||||
|
||||
Reference in new issue
Block a user