fix(auth): group typeorm annotations

This commit is contained in:
Karol Sójko
2022-10-05 14:26:36 +02:00
parent b92af6cec6
commit a02a26ebdc
3 changed files with 36 additions and 6 deletions
+6 -1
View File
@@ -13,6 +13,11 @@ export class Group {
})
declare type: GroupType
@OneToMany(() => GroupUser, (groupUser) => groupUser.group)
@OneToMany(
/* istanbul ignore next */
() => GroupUser,
/* istanbul ignore next */
(groupUser) => groupUser.group,
)
declare users: Promise<User[]>
}
+24 -4
View File
@@ -34,11 +34,31 @@ export class GroupUser {
})
declare encryptedGroupKey: string
@ManyToOne(() => User, (user) => user.groups, { onDelete: 'CASCADE' })
@JoinColumn({ name: 'user_uuid' })
@ManyToOne(
/* istanbul ignore next */
() => User,
/* istanbul ignore next */
(user) => user.groups,
/* istanbul ignore next */
{ onDelete: 'CASCADE' },
)
@JoinColumn(
/* istanbul ignore next */
{ name: 'user_uuid' },
)
declare user: Promise<User>
@ManyToOne(() => Group, (group) => group.users, { onDelete: 'CASCADE' })
@JoinColumn({ name: 'group_uuid' })
@ManyToOne(
/* istanbul ignore next */
() => Group,
/* istanbul ignore next */
(group) => group.users,
/* istanbul ignore next */
{ onDelete: 'CASCADE' },
)
@JoinColumn(
/* istanbul ignore next */
{ name: 'group_uuid' },
)
declare group: Promise<Group>
}
+6 -1
View File
@@ -194,7 +194,12 @@ export class User {
)
declare analyticsEntity: Promise<AnalyticsEntity>
@OneToMany(() => GroupUser, (groupUser) => groupUser.user)
@OneToMany(
/* istanbul ignore next */
() => GroupUser,
/* istanbul ignore next */
(groupUser) => groupUser.user,
)
declare groups: Promise<Group[]>
supportsSessions(): boolean {