fix(api): invert kobo book type check for downloads (#432)
* fix(api): invert kobo book type check for downloads with the previous organization of code paths this leads to an exception being raised in the logs even though the response message is fine * style: drop extra newline
This commit is contained in:
@@ -174,11 +174,11 @@ public class KoboController {
|
||||
@ApiResponse(responseCode = "200", description = "Book downloaded successfully")
|
||||
@GetMapping("/v1/books/{bookId}/download")
|
||||
public void downloadBook(@Parameter(description = "Book ID") @PathVariable String bookId, HttpServletResponse response) {
|
||||
if (StringUtils.isNumeric(bookId)) {
|
||||
bookDownloadService.downloadKoboBook(Long.parseLong(bookId), response);
|
||||
if (!StringUtils.isNumeric(bookId)) {
|
||||
throw ApiError.GENERIC_NOT_FOUND.createException("Not Found");
|
||||
}
|
||||
|
||||
throw ApiError.GENERIC_NOT_FOUND.createException("Not Found");
|
||||
bookDownloadService.downloadKoboBook(Long.parseLong(bookId), response);
|
||||
}
|
||||
|
||||
@Operation(summary = "Delete book from Kobo library", description = "Delete a book from the user's Kobo library.")
|
||||
|
||||
Reference in New Issue
Block a user