From 13f406edab1c4559fa35cc0ee1929ab87e8c00cb Mon Sep 17 00:00:00 2001 From: Anders Rasmussen Date: Wed, 4 Oct 2023 09:09:06 +0200 Subject: [PATCH] #9 - Added changes according to feedback --- src/modules/item/folder/__test__/delete.test.ts | 3 ++- src/modules/item/folder/folder.controller.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/item/folder/__test__/delete.test.ts b/src/modules/item/folder/__test__/delete.test.ts index 91d9785..927c5c9 100644 --- a/src/modules/item/folder/__test__/delete.test.ts +++ b/src/modules/item/folder/__test__/delete.test.ts @@ -49,7 +49,8 @@ describe('DELETE /api/folder/:id', () => { }, }); - expect(response.body).toEqual(''); + expect(response.statusCode).toBe(204); + expect(response.body).toBe(''); await expect(folderService.getByItemId(folder.id)).rejects.toThrowError(); await expect(itemService.getById(folder.id)).rejects.toThrowError(); diff --git a/src/modules/item/folder/folder.controller.ts b/src/modules/item/folder/folder.controller.ts index 2f61f2b..f2fa6da 100644 --- a/src/modules/item/folder/folder.controller.ts +++ b/src/modules/item/folder/folder.controller.ts @@ -105,6 +105,7 @@ export default class FolderController { } await this.folderService.deleteFolderByItemId(request.params.id); + return reply.code(204).send(); } catch (e) { if (e instanceof Error) { return reply.badRequest(request.i18n.t(e.message));