summary refs log tree commit diff
path: root/util
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-02 21:31:44 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-02 21:31:44 +0200
commit4c4bc248a5456e95b11102ee293fc5e7b37a83fa (patch)
tree984b7b8c6528d3a1a4bddeb81a2101e6258906c3 /util
parentMerge branch 'master' of https://github.com/fosscord/fosscord-api (diff)
downloadserver-4c4bc248a5456e95b11102ee293fc5e7b37a83fa.tar.xz
:bug: fix entity missing an id (replace .insert with new Entity().save)
Diffstat (limited to 'util')
-rw-r--r--util/src/entities/Channel.ts2
-rw-r--r--util/src/entities/Member.ts6
2 files changed, 4 insertions, 4 deletions
diff --git a/util/src/entities/Channel.ts b/util/src/entities/Channel.ts
index e3586dfc..0be1c5ec 100644
--- a/util/src/entities/Channel.ts
+++ b/util/src/entities/Channel.ts
@@ -144,7 +144,7 @@ export class Channel extends BaseClass {
 		};
 
 		await Promise.all([
-			Channel.insert(channel),
+			new Channel(channel).save(),
 			!opts?.skipEventEmit
 				? emitEvent({
 						event: "CHANNEL_CREATE",
diff --git a/util/src/entities/Member.ts b/util/src/entities/Member.ts
index e0dd411a..502f4813 100644
--- a/util/src/entities/Member.ts
+++ b/util/src/entities/Member.ts
@@ -205,7 +205,7 @@ export class Member extends BaseClass {
 		guild.joined_at = member.joined_at.toISOString();
 
 		await Promise.all([
-			Member.insert({
+			new Member({
 				...member,
 				roles: undefined,
 				// read_state: {},
@@ -218,7 +218,7 @@ export class Member extends BaseClass {
 					suppress_roles: false,
 					version: 0,
 				},
-			}),
+			}).save(),
 			Guild.increment({ id: guild_id }, "member_count", 1),
 			emitEvent({
 				event: "GUILD_MEMBER_ADD",
@@ -231,7 +231,7 @@ export class Member extends BaseClass {
 			} as GuildMemberAddEvent),
 			emitEvent({
 				event: "GUILD_CREATE",
-				data: { ...guild, members: [...guild.members, member] },
+				data: { ...guild, members: [...guild.members, { ...member, user }] },
 				user_id,
 			} as GuildCreateEvent),
 		]);