Skip to content
Snippets Groups Projects

Refactor result and book detail

Merged Muh Habibi Haidir requested to merge habibi_book into master
Compare and
9 files
+ 174
95
Preferences
Compare changes
Files
9
@@ -12,7 +12,11 @@
$id = (int)$request->params["book_id"];
$books = $this->bookDb->getBookById($id);
if ($books) {
writeResponse(200, "Success get book detail", $books);
$data = [
"books" => $books,
];
render('bookDetail.php', $data);
} else {
writeResponse(500, 'Failed get book detail');
}
@@ -21,7 +25,11 @@
function searchBook(Request $request) {
$title = $request->queries["title"];
$books = $this->bookDb->getBookByTitle($title);
writeResponse(200, "Success get book by title : %" + $title + "%", $books);
$data = [
"books" => $books,
];
render('searchResult.php', $data);
}
}