Creating a control panel infrastructure

This commit is contained in:
2026-07-23 19:41:21 +03:30
parent 7fbc47766c
commit ddf36f8470
18 changed files with 3377 additions and 35 deletions
+8 -2
View File
@@ -17,9 +17,9 @@ export class TenantsService {
) {}
async findAll(product?: ProductType) {
return this.prisma.tenant.findMany({
const rows = await this.prisma.tenant.findMany({
where: product ? { product } : undefined,
orderBy: { createdAt: 'desc' },
orderBy: { nameFa: 'asc' },
select: {
id: true,
product: true,
@@ -35,12 +35,18 @@ export class TenantsService {
nodeWs: true,
appUrl: true,
adminUrl: true,
appUiConfig: true,
isActive: true,
notes: true,
createdAt: true,
updatedAt: true,
},
});
return rows.map(({ appUiConfig, ...rest }) => ({
...rest,
hasAppUiConfig: Boolean(appUiConfig),
}));
}
async findOne(id: string) {