Compare commits

..

No commits in common. "0c94d16b1945d1ed6a34698684ce7a7230c9ab8c" and "e9318220103f8258508eeb6bdbed9eda3703bba8" have entirely different histories.

3 changed files with 17 additions and 19 deletions

View File

@ -6,37 +6,39 @@ import {
Param, Param,
ParseIntPipe, ParseIntPipe,
Post, Post,
Query, UseGuards Query,
} from '@nestjs/common'; } from "@nestjs/common";
import { AuthorsService } from "apps/backend/src/app/authors/authors.service"; import { AuthorsService } from "apps/backend/src/app/authors/authors.service";
import { AdminGuard } from 'apps/backend/src/app/auth/auth.guard';
@Controller("authors") @Controller("authors")
export class AuthorsController { export class AuthorsController {
constructor(private readonly authorService: AuthorsService) {} constructor(private readonly authorService: AuthorsService) {}
@Get("find") @Get()
async findMany( async findMany(
@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,
) {} ) {
const query = { limit, offset, search };
}
//TODO DTO //POST a new group
@Post("new") @Post("new")
async newAuthor() {} async newAuthor() {}
@UseGuards(AdminGuard) //DELETE a group
@Delete(":autor") @Delete(":authorId")
async deleteAuthor(@Param("machineId") machineId: string) {} async deleteAuthor(@Param("authorId") authorId: string) {}
//TODO Patch //GET files associated to authors with limit and offset
@Get(":authorId")
@Get(":author/files") async getForAuthor(
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("authorId") authorId: string,
) {} ) {
const query = { limit, offset, search };
}
} }

View File

@ -25,7 +25,6 @@ export class GroupsController {
@Query("search", new DefaultValuePipe("")) search: string, @Query("search", new DefaultValuePipe("")) search: string,
) {} ) {}
//TODO DTO
@Post("new") @Post("new")
async newGroup() {} async newGroup() {}

View File

@ -24,7 +24,6 @@ export class MachinesController {
@Query("search", new DefaultValuePipe("")) search: string, @Query("search", new DefaultValuePipe("")) search: string,
) {} ) {}
//TODO DTO
@UseGuards(AdminGuard) @UseGuards(AdminGuard)
@Post("new") @Post("new")
async newMachine() {} async newMachine() {}
@ -35,8 +34,6 @@ export class MachinesController {
//TODO Patch //TODO Patch
//TODO CRUD fileType associated to machine
@Get(":machineId/files") @Get(":machineId/files")
async getFilesForMachine( async getFilesForMachine(
@Query("limit", new DefaultValuePipe(20), ParseIntPipe) limit: number, @Query("limit", new DefaultValuePipe(20), ParseIntPipe) limit: number,