Implement machine list retrieval in controllers

Add functionality to fetch and return a list of machines with limit, offset, and search parameters using the machineService. This enhances the controller's capability to handle queries more effectively.
This commit is contained in:
Mathis H (Avnyr) 2024-10-10 14:10:23 +02:00
parent 3d67b8ad18
commit 0874ffb835
Signed by: Mathis
GPG Key ID: DD9E0666A747D126

View File

@ -26,7 +26,9 @@ export class MachinesController {
@Query("limit", new DefaultValuePipe(20), ParseIntPipe) limit: number, @Query("limit", new DefaultValuePipe(20), ParseIntPipe) limit: number,
@Query("offset", new DefaultValuePipe(0), ParseIntPipe) offset: number, @Query("offset", new DefaultValuePipe(0), ParseIntPipe) offset: number,
@Query("search", new DefaultValuePipe("")) search: string, @Query("search", new DefaultValuePipe("")) search: string,
) {} ) {
return await this.machineService.findMany(limit, offset, search);
}
//TODO DTO //TODO DTO
@UseGuards(AdminGuard) @UseGuards(AdminGuard)