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.
This commit is contained in:
Mathis H (Avnyr) 2024-10-08 16:04:49 +02:00
parent a8a190198b
commit 86da1b7bce
Signed by: Mathis
GPG Key ID: DD9E0666A747D126

View File

@ -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) {