Remove BaseService
This commit is contained in:
parent
1fde923dbf
commit
103f6d1e7a
@ -1,13 +1,12 @@
|
|||||||
import createError from 'http-errors'
|
import { ICredentials, INewUser, IUser, trim } from '@rondo.dev/common';
|
||||||
import {BaseService} from './BaseService'
|
import { compare, hash } from 'bcrypt';
|
||||||
import {IDatabase} from '../database/IDatabase'
|
import { validate as validateEmail } from 'email-validator';
|
||||||
import {ICredentials, INewUser, IUser, trim} from '@rondo.dev/common'
|
import createError from 'http-errors';
|
||||||
import {IAuthService} from './IAuthService'
|
import { IDatabase } from '../database/IDatabase';
|
||||||
import {UserEmail} from '../entities/UserEmail'
|
import { User } from '../entities/User';
|
||||||
import {User} from '../entities/User'
|
import { UserEmail } from '../entities/UserEmail';
|
||||||
import {compare, hash} from 'bcrypt'
|
import { Validator } from '../validator';
|
||||||
import {validate as validateEmail} from 'email-validator'
|
import { IAuthService } from './IAuthService';
|
||||||
import {Validator} from '../validator'
|
|
||||||
|
|
||||||
const SALT_ROUNDS = 10
|
const SALT_ROUNDS = 10
|
||||||
const MIN_PASSWORD_LENGTH = 10
|
const MIN_PASSWORD_LENGTH = 10
|
||||||
|
|||||||
@ -1,21 +0,0 @@
|
|||||||
import {
|
|
||||||
EntityManager,
|
|
||||||
EntitySchema,
|
|
||||||
ObjectType,
|
|
||||||
Repository,
|
|
||||||
} from 'typeorm'
|
|
||||||
import {ITransactionManager} from '../database/ITransactionManager'
|
|
||||||
|
|
||||||
export abstract class BaseService {
|
|
||||||
constructor(protected readonly transactionManager: ITransactionManager) {}
|
|
||||||
|
|
||||||
getEntityManager(): EntityManager {
|
|
||||||
return this.transactionManager.getEntityManager()
|
|
||||||
}
|
|
||||||
|
|
||||||
getRepository<Entity>(
|
|
||||||
target: ObjectType<Entity> | EntitySchema<Entity> | string,
|
|
||||||
): Repository<Entity> {
|
|
||||||
return this.transactionManager.getRepository(target)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,4 +1,3 @@
|
|||||||
export * from './BaseService'
|
|
||||||
export * from './IAuthService'
|
export * from './IAuthService'
|
||||||
export * from './AuthService'
|
export * from './AuthService'
|
||||||
export * from './IUserPermissions'
|
export * from './IUserPermissions'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user