summary refs log tree commit diff
path: root/util/src/entities/VoiceState.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-31 18:10:36 +0200
committerGitHub <noreply@github.com>2021-08-31 18:10:36 +0200
commitef5df63501fa6ffee170150816878a14cd8a6cdc (patch)
tree1c9708b20b8e49d0cae48cba1030558dbbb07db8 /util/src/entities/VoiceState.ts
parentCreated list of all possible api errors and made them throwable in routes code (diff)
parentMerge branch 'typeorm' of https://github.com/fosscord/fosscord-api into typeorm (diff)
downloadserver-ef5df63501fa6ffee170150816878a14cd8a6cdc.tar.xz
Merge branch 'typeorm' into typeorm
Diffstat (limited to 'util/src/entities/VoiceState.ts')
-rw-r--r--util/src/entities/VoiceState.ts11
1 files changed, 7 insertions, 4 deletions
diff --git a/util/src/entities/VoiceState.ts b/util/src/entities/VoiceState.ts

index e9d3dfa2..c5040cf1 100644 --- a/util/src/entities/VoiceState.ts +++ b/util/src/entities/VoiceState.ts
@@ -1,4 +1,4 @@ -import { Column, Entity, JoinColumn, ManyToOne, OneToOne, RelationId } from "typeorm"; +import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm"; import { BaseClass } from "./BaseClass"; import { Channel } from "./Channel"; import { Guild } from "./Guild"; @@ -6,25 +6,28 @@ import { User } from "./User"; @Entity("voice_states") export class VoiceState extends BaseClass { + @Column({ nullable: true }) @RelationId((voice_state: VoiceState) => voice_state.guild) guild_id: string; @JoinColumn({ name: "guild_id" }) - @ManyToOne(() => Guild, (guild: Guild) => guild.id) + @ManyToOne(() => Guild) guild?: Guild; + @Column({ nullable: true }) @RelationId((voice_state: VoiceState) => voice_state.channel) channel_id: string; @JoinColumn({ name: "channel_id" }) - @ManyToOne(() => Channel, (channel: Channel) => channel.id) + @ManyToOne(() => Channel) channel: Channel; + @Column({ nullable: true }) @RelationId((voice_state: VoiceState) => voice_state.user) user_id: string; @JoinColumn({ name: "user_id" }) - @ManyToOne(() => User, (user: User) => user.id) + @ManyToOne(() => User) user: User; @Column()