Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix: added missing return for star/unstar service method

ankitsridhar16cd4750fcce29
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);
}
}