In file 'register.api.js', line 91:
user.role = request.pre.role._id
user.roleName = request.pre.role.name
...
user = await RestHapi.create(User, user, Log)
why you need to assign the 'virtual' field 'roleName'?
Why is not automatically assigned when the user is created?
I have to add the line:
user.roleRank = request.pre.role.rank
to avoid an error in user creation, but is strange that the virtual field in not automatically generated.
In file 'register.api.js', line 91:
why you need to assign the 'virtual' field 'roleName'?
Why is not automatically assigned when the user is created?
I have to add the line:
user.roleRank = request.pre.role.rank
to avoid an error in user creation, but is strange that the virtual field in not automatically generated.