summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorMathMan05 <mathmanrm@gmail.com>2026-02-05 11:00:51 -0600
committerMathMan05 <mathmanrm@gmail.com>2026-02-05 11:00:51 -0600
commitd7e468f3360f591244a9c14ab272f0dcf9e0dfc8 (patch)
tree7e83f79abf8aa236fed27c40b16ee405f106b61a /src/api
parentcreate tags (diff)
downloadserver-ts-d7e468f3360f591244a9c14ab272f0dcf9e0dfc8.tar.xz
so many type screw ups
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/channels/#channel_id/tags.ts5
-rw-r--r--src/api/routes/guilds/#guild_id/channels.ts5
2 files changed, 7 insertions, 3 deletions
diff --git a/src/api/routes/channels/#channel_id/tags.ts b/src/api/routes/channels/#channel_id/tags.ts

index 34b49156..c600752d 100644 --- a/src/api/routes/channels/#channel_id/tags.ts +++ b/src/api/routes/channels/#channel_id/tags.ts
@@ -46,7 +46,10 @@ router.post( const tag = Tag.create({ channel, - ...body, + name: body.name, + moderated: body.moderated || false, + emoji_id: body.emoji_id || undefined, + emoji_name: body.emoji_name || undefined, }); channel.available_tags?.push(tag); diff --git a/src/api/routes/guilds/#guild_id/channels.ts b/src/api/routes/guilds/#guild_id/channels.ts
index 57bc8183..493c3398 100644 --- a/src/api/routes/guilds/#guild_id/channels.ts +++ b/src/api/routes/guilds/#guild_id/channels.ts
@@ -20,6 +20,7 @@ import { route } from "@spacebar/api"; import { Channel, ChannelUpdateEvent, Guild, emitEvent } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { ChannelModifySchema, ChannelReorderSchema } from "@spacebar/schemas"; +import { ChannelCreateSchema } from "../../../../schemas/uncategorised/ChannelCreateSchema"; const router = Router({ mergeParams: true }); router.get( @@ -47,7 +48,7 @@ router.get( router.post( "/", route({ - requestBody: "ChannelModifySchema", + requestBody: "ChannelCreateSchema", permission: "MANAGE_CHANNELS", responses: { 201: { @@ -64,7 +65,7 @@ router.post( async (req: Request, res: Response) => { // creates a new guild channel https://discord.com/developers/docs/resources/guild#create-guild-channel const { guild_id } = req.params as { [key: string]: string }; - const body = req.body as ChannelModifySchema; + const body = req.body as ChannelCreateSchema; const channel = await Channel.createChannel({ ...body, guild_id }, req.user_id); channel.position = await Channel.calculatePosition(channel.id, guild_id, channel.guild);