|
|
@@ -118,8 +118,11 @@ export class UsersService {
|
|
|
}
|
|
|
let user = await this.userRepository.save(userDto)
|
|
|
if (userDto.roles.includes(Role.Api)) {
|
|
|
- this.apiUserService.create(user.id)
|
|
|
+ let apiUser = await this.apiUserService.create(user.id)
|
|
|
+ user.apiUserId = apiUser.id
|
|
|
+ user = await this.userRepository.save(user)
|
|
|
}
|
|
|
+
|
|
|
return user
|
|
|
} catch (err) {
|
|
|
throw new InternalServerErrorException(err.message)
|