summary refs log tree commit diff
path: root/api/src/routes
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-12 03:24:51 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-13 21:57:51 +0200
commit1d52b0d0721094d7f8dfaabddedd9f08a5e456a5 (patch)
tree1136d2550f7f47f4eebd560251353f9c0cd98a6f /api/src/routes
parentPush local state... (diff)
downloadserver-1d52b0d0721094d7f8dfaabddedd9f08a5e456a5.tar.xz
Fix updated client stuff...
Diffstat (limited to 'api/src/routes')
-rw-r--r--api/src/routes/channels/#channel_id/index.ts2
-rw-r--r--api/src/routes/channels/#channel_id/invites.ts2
-rw-r--r--api/src/routes/channels/#channel_id/webhooks.ts3
3 files changed, 5 insertions, 2 deletions
diff --git a/api/src/routes/channels/#channel_id/index.ts b/api/src/routes/channels/#channel_id/index.ts
index 68b52be6..70c34f05 100644
--- a/api/src/routes/channels/#channel_id/index.ts
+++ b/api/src/routes/channels/#channel_id/index.ts
@@ -71,6 +71,8 @@ export interface ChannelModifySchema {
 	nsfw?: boolean;
 	rtc_region?: string;
 	default_auto_archive_duration?: number;
+	flags?: number;
+	default_thread_rate_limit_per_user?: number;
 }
 
 router.patch("/", route({ body: "ChannelModifySchema", permission: "MANAGE_CHANNELS" }), async (req: Request, res: Response) => {
diff --git a/api/src/routes/channels/#channel_id/invites.ts b/api/src/routes/channels/#channel_id/invites.ts
index a53b1de4..c0279f49 100644
--- a/api/src/routes/channels/#channel_id/invites.ts
+++ b/api/src/routes/channels/#channel_id/invites.ts
@@ -36,7 +36,7 @@ router.post("/", route({ body: "InviteCreateSchema", permission: "CREATE_INSTANT
 
 	const invite = await OrmUtils.mergeDeep(new Invite(),{
 		code: random(),
-		temporary: req.body.temporary,
+		temporary: req.body.temporary || true,
 		uses: 0,
 		max_uses: req.body.max_uses,
 		max_age: req.body.max_age,
diff --git a/api/src/routes/channels/#channel_id/webhooks.ts b/api/src/routes/channels/#channel_id/webhooks.ts
index 8f0e0a7f..00bf4619 100644
--- a/api/src/routes/channels/#channel_id/webhooks.ts
+++ b/api/src/routes/channels/#channel_id/webhooks.ts
@@ -12,7 +12,7 @@ export interface WebhookCreateSchema {
 	 * @maxLength 80
 	 */
 	name: string;
-	avatar: string;
+	avatar?: string;
 }
 //TODO: implement webhooks
 router.get("/", route({}), async (req: Request, res: Response) => {
@@ -36,6 +36,7 @@ router.post("/", route({ body: "WebhookCreateSchema", permission: "MANAGE_WEBHOO
 	if (name === "clyde") throw new HTTPError("Invalid name", 400);
 
 	// TODO: save webhook in database and send response
+	res.json(new Webhook());
 });
 
 export default router;