diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-26 20:48:09 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-26 20:48:09 +0200 |
commit | 18deb1e4b0ea5b709a854966166077faa537ebef (patch) | |
tree | cf1d0516b47f368666a31f2428ca694c807e395b /util/src/entities/Invite.ts | |
parent | :bug: fix unit tests (diff) | |
download | server-18deb1e4b0ea5b709a854966166077faa537ebef.tar.xz |
:sparkles: use RelationId
Diffstat (limited to 'util/src/entities/Invite.ts')
-rw-r--r-- | util/src/entities/Invite.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/util/src/entities/Invite.ts b/util/src/entities/Invite.ts index 19f7206a..eac0cba0 100644 --- a/util/src/entities/Invite.ts +++ b/util/src/entities/Invite.ts @@ -1,4 +1,4 @@ -import { Column, Entity, JoinColumn, ManyToOne } from "typeorm"; +import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm"; import { BaseClass } from "./BaseClass"; import { Channel } from "./Channel"; import { Guild } from "./Guild"; @@ -27,29 +27,29 @@ export class Invite extends BaseClass { @Column() expires_at: Date; - @Column() + @RelationId((invite: Invite) => invite.guild) guild_id: string; @JoinColumn({ name: "guild_id" }) @ManyToOne(() => Guild, (guild: Guild) => guild.id) guild: Guild; - @Column() + @RelationId((invite: Invite) => invite.channel) channel_id: string; @JoinColumn({ name: "channel_id" }) @ManyToOne(() => Channel, (channel: Channel) => channel.id) channel: Channel; - @Column() + @RelationId((invite: Invite) => invite.inviter) inviter_id: string; @JoinColumn({ name: "inviter_id" }) @ManyToOne(() => User, (user: User) => user.id) inviter: User; - @Column() - target_usser_id: string; + @RelationId((invite: Invite) => invite.target_user) + target_user_id: string; @JoinColumn({ name: "target_user_id" }) @ManyToOne(() => User, (user: User) => user.id) |