refactoring: setup wizard pages with simple architecture.

This commit is contained in:
Ahmed Bouhuolia
2020-10-11 20:35:01 +02:00
parent b98ecb7569
commit e15a48dcdd
29 changed files with 608 additions and 513 deletions

View File

@@ -17,6 +17,20 @@ export default class Tenant extends BaseModel {
return ['createdAt', 'updatedAt'];
}
/**
* Virtual attributes.
*/
static get virtualAttributes() {
return ['isReady'];
}
/**
* Tenant is ready.
*/
get isReady() {
return !!(this.initializedAt && this.seededAt);
}
/**
* Query modifiers.
*/

View File

@@ -77,9 +77,7 @@ export default class TenantRepository extends SystemRepository {
* @param {number} tenantId - Tenant id.
*/
getByIdWithSubscriptions(tenantId: number) {
return this.cache.get(`tenant.id.${tenantId}.subscriptions`, () => {
return Tenant.query().findById(tenantId)
.withGraphFetched('subscriptions.plan');
});
return Tenant.query().findById(tenantId)
.withGraphFetched('subscriptions.plan');
}
}