From 86da1b7bce9925f5a83f4b770956965d11ae551b Mon Sep 17 00:00:00 2001 From: Mathis Date: Tue, 8 Oct 2024 16:04:49 +0200 Subject: [PATCH] Refactor file type insertion method in machine service Replaced variable assignment with direct return of the database insertion result to streamline the code. This improves readability and eliminates an unnecessary variable. --- apps/backend/src/app/machines/machines.service.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/backend/src/app/machines/machines.service.ts b/apps/backend/src/app/machines/machines.service.ts index 37a9e64..04d5337 100644 --- a/apps/backend/src/app/machines/machines.service.ts +++ b/apps/backend/src/app/machines/machines.service.ts @@ -149,7 +149,7 @@ export class MachinesService { if (fileType.length !== 1) throw new NotFoundException("File type not found."); - const insertFileType = await this.database + return await this.database .use() .insert(FilesTypeForMachine) .values({ @@ -158,7 +158,6 @@ export class MachinesService { }) .prepare("insertFileTypeForMachine") .execute(); - return insertFileType; } async getFilesTypes(machineId: string) {