mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 23:00:34 +00:00
fix
This commit is contained in:
@@ -21,7 +21,7 @@ export class TenancyContext {
|
|||||||
* @param {boolean} withMetadata - If true, the tenant metadata will be fetched.
|
* @param {boolean} withMetadata - If true, the tenant metadata will be fetched.
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
async getTenant(withMetadata: boolean = false) {
|
getTenant(withMetadata: boolean = false) {
|
||||||
// Get the tenant from the request headers.
|
// Get the tenant from the request headers.
|
||||||
const organizationId = this.cls.get('organizationId');
|
const organizationId = this.cls.get('organizationId');
|
||||||
|
|
||||||
@@ -33,12 +33,7 @@ export class TenancyContext {
|
|||||||
if (withMetadata) {
|
if (withMetadata) {
|
||||||
query.withGraphFetched('metadata');
|
query.withGraphFetched('metadata');
|
||||||
}
|
}
|
||||||
const queryResult = await query;
|
return query;
|
||||||
|
|
||||||
if (!queryResult) {
|
|
||||||
throw new ServiceError('TENANT_NOT_FOUND', 'Tenant not found');
|
|
||||||
}
|
|
||||||
return queryResult;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async getTenantMetadata() {
|
async getTenantMetadata() {
|
||||||
|
|||||||
Reference in New Issue
Block a user