diff --git a/apps/backend/src/app/machines/machines.service.ts b/apps/backend/src/app/machines/machines.service.ts index 04d5337..ca84f31 100644 --- a/apps/backend/src/app/machines/machines.service.ts +++ b/apps/backend/src/app/machines/machines.service.ts @@ -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>} 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(); } /**