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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user