Add HTTP status and implement file fetching
Included HTTP status code for the getFilesForMachine method. Implemented the service call to fetch files associated with a machine.
This commit is contained in:
parent
3844153340
commit
64f9cd497f
@ -3,6 +3,8 @@ import {
|
||||
DefaultValuePipe,
|
||||
Delete,
|
||||
Get,
|
||||
HttpCode,
|
||||
HttpStatus,
|
||||
Param,
|
||||
ParseBoolPipe,
|
||||
ParseIntPipe,
|
||||
@ -37,11 +39,19 @@ export class MachinesController {
|
||||
|
||||
//TODO CRUD fileType associated to machine
|
||||
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@Get("files/:machineId")
|
||||
async getFilesForMachine(
|
||||
@Query("limit", new DefaultValuePipe(20), ParseIntPipe) limit: number,
|
||||
@Query("offset", new DefaultValuePipe(0), ParseIntPipe) offset: number,
|
||||
@Query("search", new DefaultValuePipe("")) search: string,
|
||||
@Param("machineId") machineId: string,
|
||||
) {}
|
||||
) {
|
||||
return this.machineService.findFilesForMachine(
|
||||
limit,
|
||||
offset,
|
||||
search,
|
||||
machineId,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user