diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-31 17:54:09 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-31 17:54:09 +0200 |
commit | f31317851811cd172bf5690671c86a1b514f0d0c (patch) | |
tree | 29daf11ffeab2bd52648d53e0fff0c18d5cf086f /util/src/entities/Invite.ts | |
parent | added first unittests for api endpoints (diff) | |
download | server-f31317851811cd172bf5690671c86a1b514f0d0c.tar.xz |
:sparkles: delete _ids from entities
Diffstat (limited to 'util/src/entities/Invite.ts')
-rw-r--r-- | util/src/entities/Invite.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/util/src/entities/Invite.ts b/util/src/entities/Invite.ts index d8c6d69c..01e22294 100644 --- a/util/src/entities/Invite.ts +++ b/util/src/entities/Invite.ts @@ -27,32 +27,36 @@ export class Invite extends BaseClass { @Column() expires_at: Date; + @Column({ nullable: true }) @RelationId((invite: Invite) => invite.guild) guild_id: string; @JoinColumn({ name: "guild_id" }) - @ManyToOne(() => Guild, (guild: Guild) => guild.id) + @ManyToOne(() => Guild) guild: Guild; + @Column({ nullable: true }) @RelationId((invite: Invite) => invite.channel) channel_id: string; @JoinColumn({ name: "channel_id" }) - @ManyToOne(() => Channel, (channel: Channel) => channel.id) + @ManyToOne(() => Channel) channel: Channel; + @Column({ nullable: true }) @RelationId((invite: Invite) => invite.inviter) inviter_id: string; @JoinColumn({ name: "inviter_id" }) - @ManyToOne(() => User, (user: User) => user.id) + @ManyToOne(() => User) inviter: User; + @Column({ nullable: true }) @RelationId((invite: Invite) => invite.target_user) target_user_id: string; @JoinColumn({ name: "target_user_id" }) - @ManyToOne(() => User, (user: User) => user.id) + @ManyToOne(() => User) target_user?: string; // could be used for "User specific invites" https://github.com/fosscord/fosscord/issues/62 @Column({ nullable: true }) |