summary refs log tree commit diff
path: root/src/routes/guilds
diff options
context:
space:
mode:
authorDiego Magdaleno <diegomagdaleno@protonmail.com>2021-05-23 13:43:38 -0500
committerDiego Magdaleno <diegomagdaleno@protonmail.com>2021-05-23 13:43:38 -0500
commit28424ed95030e700f9aa8d6f4305da045f260a39 (patch)
tree29c5d85351363f7f189a61e2da52c214e597c0dd /src/routes/guilds
parentMerge branch 'fosscord-master' (diff)
downloadserver-28424ed95030e700f9aa8d6f4305da045f260a39.tar.xz
Fix: No more type casting required, rather take the gernics
Diffstat (limited to 'src/routes/guilds')
-rw-r--r--src/routes/guilds/index.ts2
-rw-r--r--src/routes/guilds/templates/index.ts2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/routes/guilds/index.ts b/src/routes/guilds/index.ts

index 9e787e5b..8860bcdf 100644 --- a/src/routes/guilds/index.ts +++ b/src/routes/guilds/index.ts
@@ -15,7 +15,7 @@ const router: Router = Router(); router.post("/", check(GuildCreateSchema), async (req: Request, res: Response) => { const body = req.body as GuildCreateSchema; - const { maxGuilds } = (Config.apiConfig.getAll() as Config.DefaultOptions).limits.user; + const { maxGuilds } = Config.apiConfig.getAll().limits.user; const user = await getPublicUser(req.user_id, { guilds: true }); if (user.guilds.length >= maxGuilds) { diff --git a/src/routes/guilds/templates/index.ts b/src/routes/guilds/templates/index.ts
index 21a3a6aa..a7af8295 100644 --- a/src/routes/guilds/templates/index.ts +++ b/src/routes/guilds/templates/index.ts
@@ -21,7 +21,7 @@ router.post("/:code", check(GuildTemplateCreateSchema), async (req: Request, res const { code } = req.params; const body = req.body as GuildTemplateCreateSchema; - const { maxGuilds } = (Config.apiConfig.getAll() as Config.DefaultOptions).limits.user; + const { maxGuilds } = Config.apiConfig.getAll().limits.user; const user = await getPublicUser(req.user_id, { guilds: true }); if (user.guilds.length >= maxGuilds) {