From c3b332acf95a48b8ede10a080d995c6faf46a87b Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sun, 11 Jun 2023 21:56:56 -0700 Subject: [PATCH] seperate error for null followers --- .../backend/src/server/api/endpoints/users/followers.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/users/followers.ts b/packages/backend/src/server/api/endpoints/users/followers.ts index 138343d9f4..6559a4b41a 100644 --- a/packages/backend/src/server/api/endpoints/users/followers.ts +++ b/packages/backend/src/server/api/endpoints/users/followers.ts @@ -37,6 +37,12 @@ export const meta = { code: "FORBIDDEN", id: "3c6a84db-d619-26af-ca14-06232a21df8a", }, + + nullFollowers: { + message: "No followers found.", + code: "NULL_FOLLOWERS", + id: "174a6507-a6c2-4925-8e5d-92fd08aedc9e", + } }, } as const; @@ -97,7 +103,7 @@ export default define(meta, paramDef, async (ps, me) => { followerId: me.id, }); if (following == null) { - throw new ApiError(meta.errors.forbidden); + throw new ApiError(meta.errors.nullFollowers); } } }