parent
a3b79ef21d
commit
451d0c92dd
|
@ -42,14 +42,16 @@ export class CreateUser {
|
|||
}
|
||||
let found_groups = []
|
||||
this.groupId.forEach(async (g) => {
|
||||
const foundGroup = await getConnectionManager().get().getRepository(UserGroup).find({ id: g });
|
||||
if (foundGroup) {
|
||||
found_groups.push(foundGroup)
|
||||
} else {
|
||||
throw new UserGroupNotFoundError();
|
||||
}
|
||||
const foundGroup = await getConnectionManager().get().getRepository(UserGroup).findOne({ id: g });
|
||||
console.log(foundGroup);
|
||||
found_groups.push(foundGroup)
|
||||
});
|
||||
newUser.groups = found_groups
|
||||
console.log(found_groups);
|
||||
if (found_groups.includes(undefined) || found_groups.includes(null)) {
|
||||
throw new UserGroupNotFoundError();
|
||||
} else {
|
||||
newUser.groups = found_groups
|
||||
}
|
||||
}
|
||||
|
||||
const new_uuid = uuid.v4()
|
||||
|
|
Loading…
Reference in New Issue