mirror of
https://github.com/MrSedan/neuro-reply-website.git
synced 2026-01-14 12:49:41 +03:00
Undefined check
This commit is contained in:
@@ -18,8 +18,9 @@ export class ProxyService {
|
|||||||
async newUser(data: IProxyUser) {
|
async newUser(data: IProxyUser) {
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
(await this.proxyUserRepository.findOne({ where: { userName: data.userName } })) ||
|
(await this.proxyUserRepository.findOne({ where: { userName: data.userName } })) || data.user_id
|
||||||
(await this.proxyUserRepository.findOne({ where: { user_id: data.user_id } }))
|
? await this.proxyUserRepository.findOne({ where: { user_id: data.user_id } })
|
||||||
|
: false
|
||||||
)
|
)
|
||||||
throw new HttpException('User already exists', HttpStatus.FOUND);
|
throw new HttpException('User already exists', HttpStatus.FOUND);
|
||||||
const proxyUser = new ProxyUser();
|
const proxyUser = new ProxyUser();
|
||||||
|
|||||||
Reference in New Issue
Block a user