Skip to content

Commit

Permalink
feat:page Home atualized
Browse files Browse the repository at this point in the history
  • Loading branch information
Joaovitor045 committed Feb 10, 2025
1 parent 7cdc4be commit 3799389
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/books/books.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import { UpdateBookStatusDto } from './dtos/updateBookStatus.dto'; // Certifique
export class BooksController {
constructor(private readonly booksService: BooksService) {}

@Get()
async getAllBooks() {
return this.booksService.findAll();
}

@Get('search')
async searchBooks(@Query() searchParams: SearchBooksDto) {
return this.booksService.searchBooks(searchParams);
Expand Down
4 changes: 4 additions & 0 deletions src/books/books.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import { booksMock } from './books.mock';
export class BooksService {
private books = booksMock;

async findAll() {
return this.books;
}

async searchBooks(searchParams: SearchBooksDto) {
return this.books.filter(
(book) =>
Expand Down

0 comments on commit 3799389

Please sign in to comment.