mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat: register pages routes guards.
feat: retrieve all organizations details to authenticated user. feat: redux organization reducers and actions.
This commit is contained in:
@@ -63,11 +63,23 @@ export default class TenantRepository extends SystemRepository {
|
||||
|
||||
/**
|
||||
* Retrieve tenant details by the given tenant id.
|
||||
* @param {string} tenantId
|
||||
* @param {string} tenantId - Tenant id.
|
||||
*/
|
||||
getById(tenantId: number) {
|
||||
return this.cache.get(`tenant.id.${tenantId}`, () => {
|
||||
return Tenant.query().findById(tenantId);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve tenant details with associated subscriptions
|
||||
* and plans by the given tenant id.
|
||||
* @param {number} tenantId - Tenant id.
|
||||
*/
|
||||
getByIdWithSubscriptions(tenantId: number) {
|
||||
return this.cache.get(`tenant.id.${tenantId}.subscriptions`, () => {
|
||||
return Tenant.query().findById(tenantId)
|
||||
.withGraphFetched('subscriptions.plan');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user