so many type screw ups

This commit is contained in:
MathMan05
2026-02-05 11:00:51 -06:00
parent c26b0f3a4c
commit d7e468f336
7 changed files with 36 additions and 9 deletions
+4 -1
View File
@@ -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);
+3 -2
View File
@@ -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);