Update routes for file retrieval in controllers

Modified file retrieval routes for groups, authors, and machines to align with consistent structure. Changed the order of parameters in the routes to "files/:id". This enhances readability and standardizes API endpoint structures across different controllers.
This commit is contained in:
Mathis H (Avnyr) 2024-10-08 13:40:59 +02:00
parent 0c94d16b19
commit 84c66bcf05
Signed by: Mathis
GPG Key ID: DD9E0666A747D126
3 changed files with 4 additions and 4 deletions

View File

@ -32,11 +32,11 @@ export class AuthorsController {
//TODO Patch //TODO Patch
@Get(":author/files") @Get("files/:author")
async getFilesForAuthor( async getFilesForAuthor(
@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,
@Param("machineId") machineId: string, @Param("machineId") author: string,
) {} ) {}
} }

View File

@ -35,7 +35,7 @@ export class GroupsController {
//TODO Patch //TODO Patch
@Get(":groupId/files") @Get("files/:groupId")
async getFilesForGroup( async getFilesForGroup(
@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,

View File

@ -37,7 +37,7 @@ export class MachinesController {
//TODO CRUD fileType associated to machine //TODO CRUD fileType associated to machine
@Get(":machineId/files") @Get("files/:machineId")
async getFilesForMachine( async getFilesForMachine(
@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,