mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
fix: system repositories.
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user