mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
refactoring: setup wizard pages with simple architecture.
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user