Skip to content

Commit

Permalink
chore: add debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
hoeppner-dataport committed Oct 22, 2024
1 parent e5abf0a commit 2207567
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/server/src/modules/user/uc/admin-api-user.uc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@ export class AdminApiUserUc {
roleNames: RoleName[];
schoolId: EntityId;
}): Promise<CreateddUserAndAccount> {
console.log('roleNames', props.roleNames);

const roleDtos = await this.roleService.findByNames(props.roleNames);
console.log('roleDtos', roleDtos);

const roles = roleDtos.map((r) => {
if (!r.id) throw new Error();
return new RoleReference({ ...r, id: r.id });
});

console.log('roles', roles);
const user = await this.userService.save({ ...props, roles });
if (!user.id) throw new Error();
const initialPassword = nanoid(12);
Expand Down

0 comments on commit 2207567

Please sign in to comment.