Fix linting issues after merge

This commit is contained in:
ricardo 2022-04-10 21:08:26 -04:00
parent fa91b47452
commit 41bf75877c
3 changed files with 20 additions and 21 deletions

View file

@ -1,9 +1,12 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable import/no-cycle */
import * as querystring from 'querystring';
// eslint-disable-next-line import/no-extraneous-dependencies
import { pick } from 'lodash';
import express = require('express');
import * as SwaggerParser from '@apidevtools/swagger-parser';
import SwaggerParser from '@apidevtools/swagger-parser';
import { In } from 'typeorm';
import { validate as uuidValidate } from 'uuid';
import { User } from '../databases/entities/User';
@ -253,11 +256,6 @@ export async function getAllUsersAndCount(data: {
limit?: number;
offset?: number;
}): Promise<[User[], number]> {
console.log({
relations: data?.includeRole ? ['globalRole'] : undefined,
skip: data.offset,
take: data.limit,
})
const users = await Db.collections.User!.find({
where: {},
relations: data?.includeRole ? ['globalRole'] : undefined,

View file

@ -15,7 +15,7 @@ const instanceOwnerSetup = (
res: express.Response,
next: express.NextFunction,
): any => {
if (config.get('userManagement.isInstanceOwnerSetUp')) {
if (config.getEnv('userManagement.isInstanceOwnerSetUp')) {
return next();
}
return res.status(400).json({ message: 'asasas' });
@ -26,7 +26,7 @@ const emailSetup = (
res: express.Response,
next: express.NextFunction,
): any => {
if (config.get('userManagement.emails.mode')) {
if (config.getEnv('userManagement.emails.mode')) {
return next();
}
return res.status(400).json({ message: 'asasas' });
@ -51,13 +51,14 @@ const validEmail = (
res: express.Response,
next: express.NextFunction,
): any => {
req.body.forEach((invite) => {
if (!validator.isEmail(invite.email)) {
// eslint-disable-next-line no-restricted-syntax
for (const { email } of req.body) {
if (!validator.isEmail(email)) {
return res.status(400).json({
message: `Request to send email invite(s) to user(s) failed because of an invalid email address: ${invite.email}`,
message: `Request to send email invite(s) to user(s) failed because of an invalid email address: ${email}`,
});
}
});
}
next();
};

View file

@ -244,15 +244,15 @@ class App {
this.defaultWorkflowName = config.getEnv('workflows.defaultName');
this.defaultCredentialsName = config.getEnv('credentials.defaultName');
this.saveDataErrorExecution = config.get('executions.saveDataOnError') as string;
this.saveDataSuccessExecution = config.get('executions.saveDataOnSuccess') as string;
this.saveManualExecutions = config.get('executions.saveDataManualExecutions') as boolean;
this.executionTimeout = config.get('executions.timeout') as number;
this.maxExecutionTimeout = config.get('executions.maxTimeout') as number;
this.payloadSizeMax = config.get('endpoints.payloadSizeMax') as number;
this.timezone = config.get('generic.timezone') as string;
this.restEndpoint = config.get('endpoints.rest') as string;
this.publicApiEndpoint = config.get('publicApiEndpoints.path') as string;
this.saveDataErrorExecution = config.get('executions.saveDataOnError');
this.saveDataSuccessExecution = config.get('executions.saveDataOnSuccess');
this.saveManualExecutions = config.get('executions.saveDataManualExecutions');
this.executionTimeout = config.get('executions.timeout');
this.maxExecutionTimeout = config.get('executions.maxTimeout');
this.payloadSizeMax = config.get('endpoints.payloadSizeMax');
this.timezone = config.get('generic.timezone');
this.restEndpoint = config.get('endpoints.rest');
this.publicApiEndpoint = config.get('publicApiEndpoints.path');
this.activeWorkflowRunner = ActiveWorkflowRunner.getInstance();
this.testWebhooks = TestWebhooks.getInstance();