func GetAllBooksForAuthor(c echo.Context) error { authorID, err := strconv.Atoi(c.Param("id")) if err != nil { return c.JSON(http.StatusBadRequest, err.Error) } books := services.GetBookService().GetBooksByAuthor(authorID) return c.JSON(http.StatusOK, books) }
func GetAllBooks(c echo.Context) error { books := services.GetBookService().GetAllBooks() return c.JSON(http.StatusOK, books) }