Add getFilesTypes method to machines service
Implemented a new method to retrieve file types associated with a specific machine by its ID. This method queries the database and returns a promise that resolves to an array of file types.
This commit is contained in:
parent
86da1b7bce
commit
84d6743863
@ -160,8 +160,20 @@ export class MachinesService {
|
||||
.execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the file types associated with a specific machine based on the given machine ID.
|
||||
*
|
||||
* @param {string} machineId - The unique identifier of the machine whose file types are to be retrieved.
|
||||
* @return {Promise<Array<object>>} A promise that resolves to an array of file types associated with the machine.
|
||||
*/
|
||||
async getFilesTypes(machineId: string) {
|
||||
//TODO Find machineId and associated filesTypes
|
||||
return this.database
|
||||
.use()
|
||||
.select()
|
||||
.from(FilesTypeForMachine)
|
||||
.where(eq(FilesTypeForMachine.machineId, machineId))
|
||||
.prepare("getMachineFilesTypesById")
|
||||
.execute();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user