feat: 支持公开品牌 slug 解析
This commit is contained in:
1 parent
e89b751572
commit
ff5dc4e3ba
5 files changed
+13
-2
No files matched your search
@@ -148,8 +148,12 @@ export class PublicTemplateController {
|
||||
export class PublicWorkspaceController {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
@Get()
|
||||
async get(): Promise<unknown> {
|
||||
const brandId = process.env.DEFAULT_BRAND_ID ?? "00000000-0000-0000-0000-000000000001";
|
||||
async get(@Query("brandSlug") brandSlug?: string): Promise<unknown> {
|
||||
const configuredId = process.env.DEFAULT_BRAND_ID ?? "00000000-0000-0000-0000-000000000001";
|
||||
const selected = brandSlug
|
||||
? await this.prisma.brandProfile.findUnique({ where: { slug: brandSlug }, select: { id: true } })
|
||||
: null;
|
||||
const brandId = selected?.id ?? configuredId;
|
||||
const [
|
||||
brand,
|
||||
modules,
|
||||
|
||||
Reference in new issue
Block a user