From cd4750fcce29354d88c1caaac236b49a02162623 Mon Sep 17 00:00:00 2001 From: ankitsridhar16 Date: Wed, 21 Dec 2022 11:45:19 +0530 Subject: [PATCH] fix: added missing return for star/unstar service method --- .../src/user-history/user-history.service.spec.ts | 7 ------- .../src/user-history/user-history.service.ts | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/hoppscotch-backend/src/user-history/user-history.service.spec.ts b/packages/hoppscotch-backend/src/user-history/user-history.service.spec.ts index e387330c7..abb265cef 100644 --- a/packages/hoppscotch-backend/src/user-history/user-history.service.spec.ts +++ b/packages/hoppscotch-backend/src/user-history/user-history.service.spec.ts @@ -271,13 +271,6 @@ describe('UserHistoryService', () => { test('Should resolve left and error out due to invalid request ID', async () => { mockPrisma.userHistory.findFirst.mockResolvedValueOnce(null); - return expect( - await userHistoryService.starUnstarRequestInHistory('abc', '1'), - ).toEqualLeft(USER_HISTORY_NOT_FOUND); - }); - test('Should resolve left and error out due to invalid request ID', async () => { - mockPrisma.userHistory.findFirst.mockResolvedValueOnce(null); - return expect( await userHistoryService.starUnstarRequestInHistory('abc', '1'), ).toEqualLeft(USER_HISTORY_NOT_FOUND); diff --git a/packages/hoppscotch-backend/src/user-history/user-history.service.ts b/packages/hoppscotch-backend/src/user-history/user-history.service.ts index 6ff279279..dfe658c18 100644 --- a/packages/hoppscotch-backend/src/user-history/user-history.service.ts +++ b/packages/hoppscotch-backend/src/user-history/user-history.service.ts @@ -139,7 +139,7 @@ export class UserHistoryService { ); return E.right(updatedUserHistory); } catch (e) { - E.left(USER_HISTORY_NOT_FOUND); + return E.left(USER_HISTORY_NOT_FOUND); } }