Skip to content

Commit

Permalink
return the data on the patch
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiomagalhaes committed Feb 22, 2024
1 parent b831d06 commit 4fb7098
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/reminders/reminders.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('RemindersService', () => {
createQueryBuilder: jest.fn().mockImplementation(() => createQueryBuilder),
find: jest.fn(() => [Reminder]),
findOneOrFail: jest.fn(() => Reminder),
update: jest.fn(() => void 1),
update: jest.fn(() => Reminder),
delete: jest.fn(() => void 1),
};

Expand Down Expand Up @@ -68,7 +68,8 @@ describe('RemindersService', () => {
});

it('should update a reminder', async () => {
expect(await service.update('1', '2', new UpdateReminderDto())).toBe(void 1);
console.log('banana');
expect(await service.update('1', '2', new UpdateReminderDto())).toBe(Reminder);
});

it('should delete a reminder', async () => {
Expand Down
1 change: 1 addition & 0 deletions src/reminders/reminders.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export class RemindersService {

try {
await this.remindersRepository.update({ id: id, token: { id: token } }, updateReminderDto);
return await this.findOne(token, id);
} catch (error) {
throw new HttpException(`reminder.${error.name}`, HttpStatus.BAD_REQUEST);
}
Expand Down

0 comments on commit 4fb7098

Please sign in to comment.