From 716ea8b233b9a2d958da403ce546540e789d1482 Mon Sep 17 00:00:00 2001
From: unknownPerson115 <69736850+unknownPerson115@users.noreply.github.com>
Date: Thu, 23 Dec 2021 20:40:13 -0600
Subject: [PATCH 1/2] Fixed potential guild message SQL constraints
i have tied member dependencies to the author id rather than the member id to avoid a dependency cycle and you can now kick/ban someone from a guild/server and the messages will remain in the guild (just like discord) as stated in issue #441
I have also tested this code seems clean so far
(new pull request opened because of branch commit issues)
---
util/src/entities/Message.ts | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/util/src/entities/Message.ts b/util/src/entities/Message.ts
index 20a44ca3..e577d5df 100644
--- a/util/src/entities/Message.ts
+++ b/util/src/entities/Message.ts
@@ -84,8 +84,10 @@ export class Message extends BaseClass {
@RelationId((message: Message) => message.member)
member_id: string;
- @JoinColumn({ name: "member_id" })
- @ManyToOne(() => Member)
+ @JoinColumn({ name: "author_id", referencedColumnName: "id" })
+ @ManyToOne(() => User, {
+ onDelete: "CASCADE",
+ })
member?: Member;
@Column({ nullable: true })
From 8d5eb3669d93cedf49d96b99ef7d63afccad3b1b Mon Sep 17 00:00:00 2001
From: ImAaronFR <96433859+ImAaronFR@users.noreply.github.com>
Date: Mon, 31 Jan 2022 03:04:39 +0330
Subject: [PATCH 2/2] Update index.html
Compatible client version with Role Icons
---
api/client_test/index.html | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/api/client_test/index.html b/api/client_test/index.html
index 0b3a775a..384c598a 100644
--- a/api/client_test/index.html
+++ b/api/client_test/index.html
@@ -65,11 +65,11 @@
localStorage.setItem("UserSettingsStore", JSON.stringify(settings));
}
-
-
-
-
-
+
+
+
+
+