fix: added missing return for star/unstar service method

This commit is contained in:
ankitsridhar16
2022-12-21 11:45:19 +05:30
parent 0c9aa2f681
commit cd4750fcce
2 changed files with 1 additions and 8 deletions

View File

@@ -271,13 +271,6 @@ describe('UserHistoryService', () => {
test('Should resolve left and error out due to invalid request ID', async () => { test('Should resolve left and error out due to invalid request ID', async () => {
mockPrisma.userHistory.findFirst.mockResolvedValueOnce(null); 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( return expect(
await userHistoryService.starUnstarRequestInHistory('abc', '1'), await userHistoryService.starUnstarRequestInHistory('abc', '1'),
).toEqualLeft(USER_HISTORY_NOT_FOUND); ).toEqualLeft(USER_HISTORY_NOT_FOUND);

View File

@@ -139,7 +139,7 @@ export class UserHistoryService {
); );
return E.right(updatedUserHistory); return E.right(updatedUserHistory);
} catch (e) { } catch (e) {
E.left(USER_HISTORY_NOT_FOUND); return E.left(USER_HISTORY_NOT_FOUND);
} }
} }