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 | 79aee5145b6b289a001caae516477c8ab641bb8f (patch) | |
tree | 9fa55053ec5da0483e1a9de0d97089aef4559068 /util/src | |
parent | :bug: fix null user in identify (diff) | |
download | server-79aee5145b6b289a001caae516477c8ab641bb8f.tar.xz |
Fix duplicate key
Diffstat (limited to 'util/src')
-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 }); |