summary refs log tree commit diff
path: root/util/src/entities/User.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-20 23:35:32 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-20 23:35:32 +0200
commitcc33e87a1451d1b327fa8945394806cc0a7a0e91 (patch)
tree188efcac68a9498ce1d217b93a6ef34cd248a111 /util/src/entities/User.ts
parent:bug: fix errror handler (diff)
downloadserver-cc33e87a1451d1b327fa8945394806cc0a7a0e91.tar.xz
:sparkles: add option to disable all rate limits
Diffstat (limited to 'util/src/entities/User.ts')
-rw-r--r--util/src/entities/User.ts4
1 files changed, 1 insertions, 3 deletions
diff --git a/util/src/entities/User.ts b/util/src/entities/User.ts
index 4c86b2d8..b5c2c308 100644
--- a/util/src/entities/User.ts
+++ b/util/src/entities/User.ts
@@ -161,15 +161,13 @@ export class User extends BaseClass {
 	}
 
 	static async getPublicUser(user_id: string, opts?: FindOneOptions<User>) {
-		const user = await User.findOne(
+		return await User.findOneOrFail(
 			{ id: user_id },
 			{
 				...opts,
 				select: [...PublicUserProjection, ...(opts?.select || [])],
 			}
 		);
-		if (!user) throw new HTTPError("User not found", 404);
-		return user;
 	}
 }