diff options
author | The Arcane Brony <myrainbowdash949@gmail.com> | 2021-10-10 17:55:48 +0200 |
---|---|---|
committer | The Arcane Brony <myrainbowdash949@gmail.com> | 2021-10-10 17:55:48 +0200 |
commit | c9e827b3e928b0e674b2455aea71d191864efb54 (patch) | |
tree | 96fad0c94aabfe1dba2fdacea923a2535c54b070 /util/src/entities | |
parent | :bug: fix null user in identify (diff) | |
download | server-c9e827b3e928b0e674b2455aea71d191864efb54.tar.xz |
Fix duplicate key
Diffstat (limited to '')
-rw-r--r-- | util/src/entities/Guild.ts | 8 | ||||
-rw-r--r-- | util/src/entities/Invite.ts | 3 |
2 files changed, 3 insertions, 8 deletions
diff --git a/util/src/entities/Guild.ts b/util/src/entities/Guild.ts index 35595191..157f0921 100644 --- a/util/src/entities/Guild.ts +++ b/util/src/entities/Guild.ts @@ -258,14 +258,6 @@ export class Guild extends BaseClass { unavailable?: boolean; @Column({ nullable: true }) - @RelationId((guild: Guild) => guild.vanity_url) - vanity_url_code?: string; - - @JoinColumn({ name: "vanity_url_code" }) - @ManyToOne(() => Invite) - vanity_url?: Invite; - - @Column({ nullable: true }) verification_level?: number; @Column({ type: "simple-json" }) diff --git a/util/src/entities/Invite.ts b/util/src/entities/Invite.ts index 82556fab..d6b8f2f8 100644 --- a/util/src/entities/Invite.ts +++ b/util/src/entities/Invite.ts @@ -71,6 +71,9 @@ export class Invite extends BaseClass { @Column({ nullable: true }) target_user_type?: number; + @Column({ nullable: true}) + vanity_url?: boolean; + static async joinGuild(user_id: string, code: string) { const invite = await Invite.findOneOrFail({ code }); if (invite.uses++ >= invite.max_uses && invite.max_uses !== 0) await Invite.delete({ code }); |