summary refs log tree commit diff
path: root/util/src/entities/ReadState.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/ReadState.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/ReadState.ts')
-rw-r--r--util/src/entities/ReadState.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/util/src/entities/ReadState.ts b/util/src/entities/ReadState.ts

index 650ee4c3..8dd05b21 100644 --- a/util/src/entities/ReadState.ts +++ b/util/src/entities/ReadState.ts
@@ -10,25 +10,28 @@ import { User } from "./User"; @Entity("read_states") export class ReadState extends BaseClass { + @Column({ nullable: true }) @RelationId((read_state: ReadState) => read_state.channel) channel_id: string; @JoinColumn({ name: "channel_id" }) - @ManyToOne(() => Channel, (channel: Channel) => channel.id) + @ManyToOne(() => Channel) channel: Channel; + @Column({ nullable: true }) @RelationId((read_state: ReadState) => read_state.user) user_id: string; @JoinColumn({ name: "user_id" }) - @ManyToOne(() => User, (user: User) => user.id) + @ManyToOne(() => User) user: User; + @Column({ nullable: true }) @RelationId((read_state: ReadState) => read_state.last_message) last_message_id: string; @JoinColumn({ name: "last_message_id" }) - @ManyToOne(() => Message, (message: Message) => message.id) + @ManyToOne(() => Message) last_message?: Message; @Column({ nullable: true })