Creating a control panel infrastructure
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user