|
@@ -91,10 +91,12 @@ export class UsersService {
|
|
|
user.name = '0x' + randomstring.generate({ length: 8, charset: 'alphanumeric' })
|
|
user.name = '0x' + randomstring.generate({ length: 8, charset: 'alphanumeric' })
|
|
|
user.username = phone
|
|
user.username = phone
|
|
|
user.invitor = invitor || 48
|
|
user.invitor = invitor || 48
|
|
|
- const invitorUser = await this.findById(invitor)
|
|
|
|
|
- if (!!invitorUser.apiUserId) {
|
|
|
|
|
- user.apiUserId = invitorUser.apiUserId
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ const invitorUser = await this.findById(invitor)
|
|
|
|
|
+ if (!!invitorUser.apiUserId) {
|
|
|
|
|
+ user.apiUserId = invitorUser.apiUserId
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {}
|
|
|
}
|
|
}
|
|
|
user = await this.userRepository.save(user)
|
|
user = await this.userRepository.save(user)
|
|
|
if (newRegister) {
|
|
if (newRegister) {
|