summary refs log tree commit diff
path: root/api/src/schema
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-14 13:56:46 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-14 13:56:46 +0200
commit31a6c416a623c2461f1bdad56a4cbae1743d837f (patch)
treeda50a1997d93e6bd3d98a59eb960e8b1f1906058 /api/src/schema
parent:bug: fix guild create with channel template (diff)
downloadserver-31a6c416a623c2461f1bdad56a4cbae1743d837f.tar.xz
:bug: fix Guild + Channel create
Diffstat (limited to 'api/src/schema')
-rw-r--r--api/src/schema/Channel.ts2
-rw-r--r--api/src/schema/Guild.ts5
2 files changed, 5 insertions, 2 deletions
diff --git a/api/src/schema/Channel.ts b/api/src/schema/Channel.ts
index 18a8f835..bffbaa69 100644
--- a/api/src/schema/Channel.ts
+++ b/api/src/schema/Channel.ts
@@ -18,6 +18,7 @@ export const ChannelModifySchema = {
 		}
 	],
 	$parent_id: String,
+	$id: String, // kept for backwards compatibility does nothing (need for guild create)
 	$nsfw: Boolean
 };
 
@@ -46,6 +47,7 @@ export interface ChannelModifySchema {
 		deny: bigint;
 	}[];
 	parent_id?: string;
+	id?: string; // is not used (only for guild create)
 	nsfw?: boolean;
 }
 
diff --git a/api/src/schema/Guild.ts b/api/src/schema/Guild.ts
index ce40b49f..e5971baf 100644
--- a/api/src/schema/Guild.ts
+++ b/api/src/schema/Guild.ts
@@ -1,11 +1,12 @@
 import { ChannelSchema, GuildChannel } from "@fosscord/util";
 import { Length } from "../util/instanceOf";
+import { ChannelModifySchema } from "./Channel";
 
 export const GuildCreateSchema = {
 	name: new Length(String, 2, 100),
 	$region: String, // auto complete voice region of the user
 	$icon: String,
-	$channels: [Object],
+	$channels: [ChannelModifySchema],
 	$guild_template_code: String,
 	$system_channel_id: String,
 	$rules_channel_id: String
@@ -15,7 +16,7 @@ export interface GuildCreateSchema {
 	name: string;
 	region?: string;
 	icon?: string;
-	channels?: GuildChannel[];
+	channels?: ChannelModifySchema[];
 	guild_template_code?: string;
 	system_channel_id?: string;
 	rules_channel_id?: string;