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:
parent
0c94d16b19
commit
84c66bcf05
@ -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,
|
||||||
) {}
|
) {}
|
||||||
}
|
}
|
||||||
|
@ -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,
|
||||||
|
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user