summary refs log tree commit diff
path: root/src/routes/guilds
diff options
context:
space:
mode:
authorBuildTools <59115290+BanTheNons@users.noreply.github.com>2021-08-07 21:58:16 +0300
committerBuildTools <59115290+BanTheNons@users.noreply.github.com>2021-08-07 21:58:16 +0300
commit98a780ad7ce288d7ed4fec90222cff77130b6b2a (patch)
tree239bf85e91f3a564541a8e1c8a1fd9e3a72a7155 /src/routes/guilds
parent:pencil: features list (diff)
downloadserver-98a780ad7ce288d7ed4fec90222cff77130b6b2a.tar.xz
added profile banners
Diffstat (limited to 'src/routes/guilds')
-rw-r--r--src/routes/guilds/#guild_id/index.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/routes/guilds/#guild_id/index.ts b/src/routes/guilds/#guild_id/index.ts

index 8e052f6d..404a289a 100644 --- a/src/routes/guilds/#guild_id/index.ts +++ b/src/routes/guilds/#guild_id/index.ts
@@ -43,8 +43,8 @@ router.patch("/", check(GuildUpdateSchema), async (req: Request, res: Response) const perms = await getPermission(req.user_id, guild_id); perms.hasThrow("MANAGE_GUILD"); - body.icon = await handleFile(`/icons/${guild_id}`, body.icon); - body.banner = await handleFile(`/banners/${guild_id}`, body.banner); + if (body.icon) body.icon = await handleFile(`/icons/${guild_id}`, body.icon); + if(body.banner) body.banner = await handleFile(`/banners/${guild_id}`, body.banner); const guild = await GuildModel.findOneAndUpdate({ id: guild_id }, body) .populate({ path: "joined_at", match: { id: req.user_id } })