From 84c66bcf054c611e44c844f87ae5afd3a4f5b2f6 Mon Sep 17 00:00:00 2001 From: Mathis Date: Tue, 8 Oct 2024 13:40:59 +0200 Subject: [PATCH] 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. --- apps/backend/src/app/authors/authors.controller.ts | 4 ++-- apps/backend/src/app/groups/groups.controller.ts | 2 +- apps/backend/src/app/machines/machines.controller.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/backend/src/app/authors/authors.controller.ts b/apps/backend/src/app/authors/authors.controller.ts index c447be3..6bb0371 100644 --- a/apps/backend/src/app/authors/authors.controller.ts +++ b/apps/backend/src/app/authors/authors.controller.ts @@ -32,11 +32,11 @@ export class AuthorsController { //TODO Patch - @Get(":author/files") + @Get("files/:author") async getFilesForAuthor( @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, + @Param("machineId") author: string, ) {} } diff --git a/apps/backend/src/app/groups/groups.controller.ts b/apps/backend/src/app/groups/groups.controller.ts index f63ac32..cbdb55e 100644 --- a/apps/backend/src/app/groups/groups.controller.ts +++ b/apps/backend/src/app/groups/groups.controller.ts @@ -35,7 +35,7 @@ export class GroupsController { //TODO Patch - @Get(":groupId/files") + @Get("files/:groupId") async getFilesForGroup( @Query("limit", new DefaultValuePipe(20), ParseIntPipe) limit: number, @Query("offset", new DefaultValuePipe(0), ParseIntPipe) offset: number, diff --git a/apps/backend/src/app/machines/machines.controller.ts b/apps/backend/src/app/machines/machines.controller.ts index c015db9..e70fda9 100644 --- a/apps/backend/src/app/machines/machines.controller.ts +++ b/apps/backend/src/app/machines/machines.controller.ts @@ -37,7 +37,7 @@ export class MachinesController { //TODO CRUD fileType associated to machine - @Get(":machineId/files") + @Get("files/:machineId") async getFilesForMachine( @Query("limit", new DefaultValuePipe(20), ParseIntPipe) limit: number, @Query("offset", new DefaultValuePipe(0), ParseIntPipe) offset: number,