Skip to content

Commit 430ba29

Browse files
committed
Fixes when doing content changes
1 parent e7b152a commit 430ba29

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

controllers/authorController.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ exports.author_create_post = [
8989
}
9090

9191
// Data from form is valid.
92+
// Save and redirect to new author record.
9293
await author.save();
93-
// Redirect to new author record.
9494
res.redirect(author.url);
9595
},
9696
];
@@ -106,6 +106,7 @@ exports.author_delete_get = async (req, res, next) => {
106106
if (author === null) {
107107
// No results.
108108
res.redirect("/catalog/authors");
109+
return;
109110
}
110111

111112
res.render("author_delete", {

controllers/bookController.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ exports.book_list = async (req, res, next) => {
4141
res.render("book_list", { title: "Book List", book_list: allBooks });
4242
};
4343

44+
// Display detail page for a specific book.
45+
exports.book_detail_beer = async (req, res, next) => {
46+
// Get details of books, book instances for specific book
47+
console.log("beer", req.params);
48+
};
49+
4450
// Display detail page for a specific book.
4551
exports.book_detail = async (req, res, next) => {
4652
// Get details of books, book instances for specific book

routes/catalog.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ router.get("/book/create", book_controller.book_create_get);
1919
// POST request for creating Book.
2020
router.post("/book/create", book_controller.book_create_post);
2121

22+
// GET est thingyy
23+
router.get("/book/j/:filename{.:something}", book_controller.book_detail_beer);
24+
2225
// GET request to delete Book.
2326
router.get("/book/:id/delete", book_controller.book_delete_get);
2427

views/layout.pug

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ html(lang='en')
44
title= title
55
meta(charset='utf-8')
66
meta(name='viewport', content='width=device-width, initial-scale=1')
7-
link(rel="stylesheet", href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css", integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N", crossorigin="anonymous")
8-
script(src="https://code.jquery.com/jquery-3.5.1.slim.min.js", integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj", crossorigin="anonymous")
9-
script(src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.min.js", integrity="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+", crossorigin="anonymous")
7+
link(rel="stylesheet", href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css", integrity="sha384-LN+7fdVzj6u52u30Kp6M/trliBMCMKTyK833zpbD+pXdCLuTusPj697FH4R/5mcr", crossorigin="anonymous")
8+
script(src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/js/bootstrap.bundle.min.js", integrity="sha384-ndDqU0Gzau9qJ1lfW4pNLlhNTkCfHzAVBReH9diLvGRem5+R9g2FzA8ZGN954O5Q", crossorigin="anonymous")
109
link(rel='stylesheet', href='/stylesheets/style.css')
1110
body
1211
div(class='container-fluid')

0 commit comments

Comments
 (0)