feat: register pages routes guards.

feat: retrieve all organizations details to authenticated user.
feat: redux organization reducers and actions.
This commit is contained in:
Ahmed Bouhuolia
2020-10-11 00:08:51 +02:00
parent 8622320eef
commit 507690fedf
22 changed files with 348 additions and 66 deletions

View File

@@ -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');
});
}
}