Skip to content

Commit

Permalink
Merge pull request #45 from saranshbalyan-1234/mongo
Browse files Browse the repository at this point in the history
lint fix
  • Loading branch information
saranshbalyan-1234 authored Aug 2, 2024
2 parents 6cadb16 + 1b17ded commit d495f2f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Scheduler/Service/schedulerService.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Import Scheduler from 'cron-job-manager';

import { getAllTenant } from '#user/Service/database.service.js';
import { getAllTenant } from '#user/Controllers/superAdmin.controller.js';

// import db, { createDBConnection } from '#utils/dataBaseConnection.js';
import { executeCurl, executeQuery } from './jobRunner.js';
Expand Down
4 changes: 2 additions & 2 deletions User/Controllers/superAdmin.controller.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import errorContstants from '#constants/error.constant.js';
import { getTenantDB } from '#root/mongo.connection.js';
import { deleteCustomer } from '#user/Service/database.service.js';
import { getCachedKeys } from '#utils/Cache/cache.service.js';
import cache from '#utils/Cache/index.js';
import getError from '#utils/error.js';

import { getCachedKeys } from '#utils/Cache/cache.service.js';

const getAllTenant = async (req, res) => {
try {
const tenants = await req.models.customer.distinct('tenant');
Expand Down
2 changes: 1 addition & 1 deletion User/Service/database.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ const dropDatabase = async (database) => {
return false;
}
};
export { deleteCustomer, dropDatabase, getCachedKeys };
export { deleteCustomer, dropDatabase };
16 changes: 8 additions & 8 deletions Utils/Cache/cache.service.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import cache from '#utils/Cache/index.js';

const getCachedKeys = () => {
try {
return cache.keys();
} catch (e) {
throw new Error(e);
}
};
export {getCachedKeys}
try {
return cache.keys();
} catch (e) {
throw new Error(e);
}
};

export { getCachedKeys };
2 changes: 1 addition & 1 deletion Utils/Middlewares/permissions.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const validateSuperAdmin = () => (req, res, next) => {
};
const validateIssuer = () => (req, res, next) => {
try {
if (!req.user.type=='issuer') return res.status(401).json({ error: errorContstants.UNAUTHORIZED });
if (!req.user.type === 'issuer') return res.status(401).json({ error: errorContstants.UNAUTHORIZED });
return next();
} catch (e) {
return getError(e, res);
Expand Down

0 comments on commit d495f2f

Please sign in to comment.