From 1b17ded1ee2be3b9bef234f1611cc5633f78acb4 Mon Sep 17 00:00:00 2001 From: Saransh Balyan Date: Fri, 2 Aug 2024 22:27:39 +0530 Subject: [PATCH] lint fix --- Scheduler/Service/schedulerService.js | 2 +- User/Controllers/superAdmin.controller.js | 4 ++-- User/Service/database.service.js | 2 +- Utils/Cache/cache.service.js | 16 ++++++++-------- Utils/Middlewares/permissions.middleware.js | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Scheduler/Service/schedulerService.js b/Scheduler/Service/schedulerService.js index 966b0d1..2513e87 100644 --- a/Scheduler/Service/schedulerService.js +++ b/Scheduler/Service/schedulerService.js @@ -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'; diff --git a/User/Controllers/superAdmin.controller.js b/User/Controllers/superAdmin.controller.js index 167c711..dce6bf1 100644 --- a/User/Controllers/superAdmin.controller.js +++ b/User/Controllers/superAdmin.controller.js @@ -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'); diff --git a/User/Service/database.service.js b/User/Service/database.service.js index 8fd0b09..a422609 100644 --- a/User/Service/database.service.js +++ b/User/Service/database.service.js @@ -35,4 +35,4 @@ const dropDatabase = async (database) => { return false; } }; -export { deleteCustomer, dropDatabase, getCachedKeys }; +export { deleteCustomer, dropDatabase }; diff --git a/Utils/Cache/cache.service.js b/Utils/Cache/cache.service.js index d8fac73..96dc218 100644 --- a/Utils/Cache/cache.service.js +++ b/Utils/Cache/cache.service.js @@ -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} \ No newline at end of file + try { + return cache.keys(); + } catch (e) { + throw new Error(e); + } +}; + +export { getCachedKeys }; diff --git a/Utils/Middlewares/permissions.middleware.js b/Utils/Middlewares/permissions.middleware.js index e749769..e0b13fb 100644 --- a/Utils/Middlewares/permissions.middleware.js +++ b/Utils/Middlewares/permissions.middleware.js @@ -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);