From fddfd154db6438978bfe45db35cc8781c027b391 Mon Sep 17 00:00:00 2001 From: Chris Hellen Date: Tue, 9 Apr 2024 15:11:29 -0500 Subject: [PATCH] Created and implemented 'available' value in liquibase --- .../java/org/folio/sample/controller/BookController.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/org/folio/sample/controller/BookController.java b/src/main/java/org/folio/sample/controller/BookController.java index dab6350..397be8b 100644 --- a/src/main/java/org/folio/sample/controller/BookController.java +++ b/src/main/java/org/folio/sample/controller/BookController.java @@ -94,4 +94,13 @@ public ResponseEntity updateBook(UUID bookId, BookForCreationDTO newBoo HttpStatus.OK ); } + + public ResponseEntity> getAllAvailable() { + log.info("Called GET /books/available"); + + return new ResponseEntity<>( + bookService.findAllAvailable().stream().map(bookMapper::toDto).toList(), + HttpStatus.OK + ); + } }