diff --git a/src/entities/ThirdParty.ts b/src/entities/ThirdParty.ts index 80bc563..c426d06 100644 --- a/src/entities/ThirdParty.ts +++ b/src/entities/ThirdParty.ts @@ -4,13 +4,9 @@ import { CreateDateColumn, Entity, Index, - ManyToOne, - OneToMany, PrimaryGeneratedColumn, - RelationId, UpdateDateColumn, } from 'typeorm'; -import { NotificationSetting } from './notificationSetting'; // Schema designed based on https://github.com/Giveth/giveth-dapps-v2/issues/475 @Entity() diff --git a/src/entities/userAddress.ts b/src/entities/userAddress.ts index 3bc1228..392397e 100644 --- a/src/entities/userAddress.ts +++ b/src/entities/userAddress.ts @@ -4,10 +4,8 @@ import { CreateDateColumn, Entity, Index, - ManyToOne, OneToMany, PrimaryGeneratedColumn, - RelationId, UpdateDateColumn, } from 'typeorm'; import { NotificationSetting } from './notificationSetting'; @@ -23,11 +21,11 @@ export class UserAddress extends BaseEntity { @Column('text', { nullable: false }) walletAddress: string; - @OneToMany(type => Notification, notification => notification.userAddress) + @OneToMany(_type => Notification, notification => notification.userAddress) notifications?: Notification[]; @OneToMany( - type => NotificationSetting, + _type => NotificationSetting, notificationSetting => notificationSetting.userAddress, ) settings?: NotificationSetting[]; diff --git a/src/repositories/userAddressRepository.test.ts b/src/repositories/userAddressRepository.test.ts index 5a70961..1d83a14 100644 --- a/src/repositories/userAddressRepository.test.ts +++ b/src/repositories/userAddressRepository.test.ts @@ -2,10 +2,8 @@ import { assert } from 'chai'; import { generateRandomEthereumAddress, saveUserAddressDirectlyToDb, - sleep, } from '../../test/testUtils'; import { NotificationSetting } from '../entities/notificationSetting'; -import { MICRO_SERVICES } from '../utils/utils'; import { createNewUserAddress, createNewUserAddressIfNotExists, diff --git a/src/validators/schemaValidators.ts b/src/validators/schemaValidators.ts index 7540433..ad13c7f 100644 --- a/src/validators/schemaValidators.ts +++ b/src/validators/schemaValidators.ts @@ -1,10 +1,9 @@ -import Joi, { number, ObjectSchema, ValidationResult } from 'joi'; +import Joi, { ObjectSchema, ValidationResult } from 'joi'; import { StandardError } from '../types/StandardError'; import { errorMessagesEnum } from '../utils/errorMessages'; const ethereumWalletAddressRegex = /^0x[a-fA-F0-9]{40}$/; const solanaWalletAddressRegex = /^[A-Za-z0-9]{43,44}$/; -const txHashRegex = /^0x[a-fA-F0-9]{64}$/; export const validateWithJoiSchema = (data: any, schema: ObjectSchema) => { const validationResult = schema.validate(data); diff --git a/test/pre-test-scripts.ts b/test/pre-test-scripts.ts index ec4cbca..80cf4cd 100644 --- a/test/pre-test-scripts.ts +++ b/test/pre-test-scripts.ts @@ -1,13 +1,11 @@ -import dotenv from 'dotenv'; import * as path from 'path'; +import dotenv from 'dotenv'; dotenv.config({ path: path.resolve(__dirname, `../config/${process.env.NODE_ENV || ''}.env`), }); import { initServer } from '../src/server'; import { AppDataSource } from '../src/dataSource'; -import { ThirdParty } from '../src/entities/ThirdParty'; -import { Notification } from '../src/entities/notification'; import { sleep } from './testUtils'; /* eslint-disable @typescript-eslint/no-var-requires */ diff --git a/test/testUtils.ts b/test/testUtils.ts index 9890c5d..c13503d 100644 --- a/test/testUtils.ts +++ b/test/testUtils.ts @@ -1,10 +1,10 @@ import { assert } from 'chai'; +import { sign } from 'jsonwebtoken'; +import { Keypair } from '@solana/web3.js'; import { Notification } from '../src/entities/notification'; import { UserAddress } from '../src/entities/userAddress'; import { NotificationType } from '../src/entities/notificationType'; import { createBasicAuthentication } from '../src/utils/authorizationUtils'; -import { sign } from 'jsonwebtoken'; -import { Keypair } from '@solana/web3.js'; // eslint:disable-next-line export const serverUrl = 'http://localhost:3041';