fix lint.

This commit is contained in:
Nawaz Dhandala 2021-07-22 10:53:00 +01:00
parent bb4e9f95df
commit 9b9e38eea8
6 changed files with 11 additions and 8 deletions

View File

@ -434,7 +434,7 @@ router.post('/sso/callback', async function(req, res) {
code: 400,
message: 'SSO not defined for the domain.',
});
x;
if (!sso['saml-enabled'])
return sendErrorResponse(req, res, {
code: 401,

View File

@ -267,7 +267,7 @@ module.exports = {
},
deleteBy: async function(query) {
try {
let domainCount = await this.countBy(query);
const domainCount = await this.countBy(query);
if (!domainCount || domainCount === 0) {
const error = new Error('Domain not found or does not exist');
@ -275,7 +275,7 @@ module.exports = {
throw error;
}
domain = await this.updateOneBy(query, {
const domain = await this.updateOneBy(query, {
deleted: true,
deletedAt: Date.now(),
});

View File

@ -97,7 +97,10 @@ module.exports = {
},
{ new: true }
);
gitCredential = await this.findOneBy({ _id: gitCredential._id, deleted: gitCredential.deleted }); // This is needed for proper query. It considers deleted and non-deleted git credentials
gitCredential = await this.findOneBy({
_id: gitCredential._id,
deleted: gitCredential.deleted,
}); // This is needed for proper query. It considers deleted and non-deleted git credentials
if (!gitCredential) {
const error = new Error(

View File

@ -50,7 +50,7 @@ module.exports = {
incidentPrioritiesQuery
);
const incidentPriorities = await incidentPriorities;
const incidentPriorities = await incidentPrioritiesQuery;
return incidentPriorities;
} catch (error) {

View File

@ -286,6 +286,3 @@ describe('SSO API', function() {
});
});
});
const selectSso =
'_id saml-enabled domain entityId remoteLoginUrl certificateFingerprint remoteLogoutUrl ipRanges createdAt deleted deletedAt deletedById samlSsoUrl';

View File

@ -28,10 +28,13 @@ function getMongoClient() {
const client = getMongoClient();
(async function() {
try {
// eslint-disable-next-line no-console
console.log('connecting to db');
await client.connect();
// eslint-disable-next-line no-console
console.log('connected to db');
} catch (error) {
// eslint-disable-next-line no-console
console.log('connection error: ', error);
}
})();