summary refs log tree commit diff
path: root/api/src/routes/guilds
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-18 00:19:53 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-18 00:19:53 +0200
commit24896d0c23675f40139ab86617aba81c8a6508ff (patch)
treebdce3d68f4d89279b8340008bc13a895ba4912d3 /api/src/routes/guilds
parent:bug: fix body parse treating null not as undefined (except for icons/avatars) (diff)
downloadserver-24896d0c23675f40139ab86617aba81c8a6508ff.tar.xz
:bug: fix guild create icon
Diffstat (limited to 'api/src/routes/guilds')
-rw-r--r--api/src/routes/guilds/index.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/api/src/routes/guilds/index.ts b/api/src/routes/guilds/index.ts
index 2e68d953..3612ca82 100644
--- a/api/src/routes/guilds/index.ts
+++ b/api/src/routes/guilds/index.ts
@@ -1,6 +1,6 @@
 import { Router, Request, Response } from "express";
 import { Role, Guild, Snowflake, Config, User, Member, Channel } from "@fosscord/util";
-import { route } from "@fosscord/api";
+import { handleFile, route } from "@fosscord/api";
 import { DiscordApiErrors } from "@fosscord/util";
 import { ChannelModifySchema } from "../channels/#channel_id";
 
@@ -34,6 +34,7 @@ router.post("/", route({ body: "GuildCreateSchema" }), async (req: Request, res:
 
 	await Guild.insert({
 		name: body.name,
+		icon: await handleFile(`/icons/${guild_id}`, body.icon as string),
 		region: Config.get().regions.default,
 		owner_id: req.user_id,
 		afk_timeout: 300,