summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-24 19:46:33 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-24 19:46:33 +1100
commita2f57627913bf5d402b73933374693382a387ed2 (patch)
tree79c6c821306421907f78960298160a0067de3e68 /src
parentrearrange test client's index a bit (diff)
downloadserver-a2f57627913bf5d402b73933374693382a387ed2.tar.xz
Forgot some schemas + only generate schemas in util/schemas + add setup script
Diffstat (limited to 'src')
-rw-r--r--src/api/routes/guilds/#guild_id/channels.ts8
-rw-r--r--src/api/routes/guilds/#guild_id/roles/index.ts6
-rw-r--r--src/util/schemas/ChannelReorderSchema.ts6
-rw-r--r--src/util/schemas/RolePositionUpdateSchema.ts4
-rw-r--r--src/util/schemas/index.ts4
5 files changed, 15 insertions, 13 deletions
diff --git a/src/api/routes/guilds/#guild_id/channels.ts b/src/api/routes/guilds/#guild_id/channels.ts
index af17465d..eae93607 100644
--- a/src/api/routes/guilds/#guild_id/channels.ts
+++ b/src/api/routes/guilds/#guild_id/channels.ts
@@ -4,6 +4,7 @@ import {
 	ChannelUpdateEvent,
 	emitEvent,
 	ChannelModifySchema,
+	ChannelReorderSchema,
 } from "@fosscord/util";
 import { HTTPError } from "lambert-server";
 import { route } from "@fosscord/api";
@@ -33,13 +34,6 @@ router.post(
 	},
 );
 
-export type ChannelReorderSchema = {
-	id: string;
-	position?: number;
-	lock_permissions?: boolean;
-	parent_id?: string;
-}[];
-
 router.patch(
 	"/",
 	route({ body: "ChannelReorderSchema", permission: "MANAGE_CHANNELS" }),
diff --git a/src/api/routes/guilds/#guild_id/roles/index.ts b/src/api/routes/guilds/#guild_id/roles/index.ts
index e3c7373e..60399d1b 100644
--- a/src/api/routes/guilds/#guild_id/roles/index.ts
+++ b/src/api/routes/guilds/#guild_id/roles/index.ts
@@ -9,16 +9,12 @@ import {
 	Config,
 	DiscordApiErrors,
 	RoleModifySchema,
+	RolePositionUpdateSchema,
 } from "@fosscord/util";
 import { route } from "@fosscord/api";
 
 const router: Router = Router();
 
-export type RolePositionUpdateSchema = {
-	id: string;
-	position: number;
-}[];
-
 router.get("/", route({}), async (req: Request, res: Response) => {
 	const guild_id = req.params.guild_id;
 
diff --git a/src/util/schemas/ChannelReorderSchema.ts b/src/util/schemas/ChannelReorderSchema.ts
new file mode 100644
index 00000000..6eb4cdd5
--- /dev/null
+++ b/src/util/schemas/ChannelReorderSchema.ts
@@ -0,0 +1,6 @@
+export type ChannelReorderSchema = {
+	id: string;
+	position?: number;
+	lock_permissions?: boolean;
+	parent_id?: string;
+}[];
\ No newline at end of file
diff --git a/src/util/schemas/RolePositionUpdateSchema.ts b/src/util/schemas/RolePositionUpdateSchema.ts
new file mode 100644
index 00000000..1019d504
--- /dev/null
+++ b/src/util/schemas/RolePositionUpdateSchema.ts
@@ -0,0 +1,4 @@
+export type RolePositionUpdateSchema = {
+	id: string;
+	position: number;
+}[];
\ No newline at end of file
diff --git a/src/util/schemas/index.ts b/src/util/schemas/index.ts
index ba9e71e4..8881b247 100644
--- a/src/util/schemas/index.ts
+++ b/src/util/schemas/index.ts
@@ -42,4 +42,6 @@ export * from "./LazyRequestSchema";
 export * from "./GuildUpdateSchema";
 export * from "./ChannelPermissionOverwriteSchema";
 export * from "./UserGuildSettingsSchema";
-export * from "./GatewayPayloadSchema"
\ No newline at end of file
+export * from "./GatewayPayloadSchema";
+export * from "./RolePositionUpdateSchema";
+export * from "./ChannelReorderSchema";
\ No newline at end of file