fix: system repositories.

This commit is contained in:
a.bouhuolia
2020-12-17 17:19:16 +02:00
parent 7a847fc895
commit a67b1fbdd0
54 changed files with 1452 additions and 983 deletions

View File

@@ -13,7 +13,7 @@ const attachCurrentUser = async (req: Request, res: Response, next: Function) =>
try {
Logger.info('[attach_user_middleware] finding system user by id.');
const user = await systemUserRepository.getById(req.token.id);
const user = await systemUserRepository.findOneById(req.token.id);
console.log(user);
if (!user) {

View File

@@ -20,7 +20,7 @@ export default async (req: Request, res: Response, next: NextFunction) => {
const { tenantRepository } = Container.get('repositories');
Logger.info('[tenancy_middleware] trying get tenant by org. id from storage.');
const tenant = await tenantRepository.getByOrgId(organizationId);
const tenant = await tenantRepository.findOne({ organizationId });
// When the given organization id not found on the system storage.
if (!tenant) {