From 575ef11dc76d5d96f91e0a8d7fd2011b8a75d35e Mon Sep 17 00:00:00 2001 From: fabcodingzest <48706652+fabcodingzest@users.noreply.github.com> Date: Wed, 2 Sep 2020 11:18:37 +0530 Subject: [PATCH 1/4] removed simple page layout --- helpers/getOverview.js | 2 +- routes/api/addBalance.js | 4 ++-- routes/api/cart.js | 2 +- routes/api/edit.js | 2 +- routes/api/transaction.js | 8 ++++---- routes/api/view.js | 2 +- views/layouts/simple-page.ejs | 27 --------------------------- 7 files changed, 10 insertions(+), 37 deletions(-) delete mode 100644 views/layouts/simple-page.ejs diff --git a/helpers/getOverview.js b/helpers/getOverview.js index 23dcf3a..e084b42 100644 --- a/helpers/getOverview.js +++ b/helpers/getOverview.js @@ -36,7 +36,7 @@ module.exports = async function getOverview(symbol) { })) .catch((err) => { console.log(err); - res.status(500).render("error/500", { layout: "layouts/simple-page" }); + res.status(500).render("error/500"); }); return data; diff --git a/routes/api/addBalance.js b/routes/api/addBalance.js index 3d15d61..3d3e1e7 100644 --- a/routes/api/addBalance.js +++ b/routes/api/addBalance.js @@ -47,7 +47,7 @@ router.post("/", ensureAuth, async (req, res) => { }, (err) => { if (err && err.type === "StripeCardError") { - return res.render("error/500", { layout: "layouts/simple-page" }); + return res.render("error/500"); } else { console.log("Payment Success"); } @@ -79,7 +79,7 @@ router.post("/", ensureAuth, async (req, res) => { res.redirect("/done"); } catch (err) { console.error(err); - res.render("error/500", { layout: "layouts/simple-page" }); + res.render("error/500"); } }); diff --git a/routes/api/cart.js b/routes/api/cart.js index 89c8a70..ea2fa0a 100644 --- a/routes/api/cart.js +++ b/routes/api/cart.js @@ -71,7 +71,7 @@ router.post("/buy", ensureAuth, async (req, res) => { } } catch (err) { console.error(err); - res.render("error/500", { layout: "layouts/simple-page" }); + res.render("error/500"); } }); diff --git a/routes/api/edit.js b/routes/api/edit.js index 237fb78..ff64701 100644 --- a/routes/api/edit.js +++ b/routes/api/edit.js @@ -60,7 +60,7 @@ router.put("/", ensureAuth, async (req, res) => { res.redirect("/portfolio"); } catch (err) { console.error(err); - return res.render("error/500", { layout: "layouts/simple-page" }); + return res.render("error/500"); } }); diff --git a/routes/api/transaction.js b/routes/api/transaction.js index d6ecc62..c6fce91 100644 --- a/routes/api/transaction.js +++ b/routes/api/transaction.js @@ -119,7 +119,7 @@ router.put("/confirm", ensureAuth, async (req, res) => { res.redirect("/done"); } catch (err) { console.error(err); - res.render("error/500", { layout: "layouts/simple-page" }); + res.render("error/500"); } }); @@ -159,7 +159,7 @@ router.get("/", ensureAuth, async (req, res) => { } } catch (err) { console.error(err); - res.render("error/500", { layout: "layouts/simple-page" }); + res.render("error/500"); } }); @@ -208,10 +208,10 @@ router.post("/sell/:id", ensureAuth, async (req, res) => { } }); - res.redirect("/done", { layout: "layouts/simple-page" }); + res.redirect("/done"); } catch (err) { console.error(err); - res.render("error/500", { layout: "layouts/simple-page" }); + res.render("error/500"); } }); diff --git a/routes/api/view.js b/routes/api/view.js index 7da627e..4d37b98 100644 --- a/routes/api/view.js +++ b/routes/api/view.js @@ -102,7 +102,7 @@ router.get("/:symbol", ensureAuth, async (req, res) => { }) .catch((err) => { console.error(err); - res.render("error/404", { layout: "layouts/simple-page" }); + res.render("error/404"); }); }); diff --git a/views/layouts/simple-page.ejs b/views/layouts/simple-page.ejs deleted file mode 100644 index 648d879..0000000 --- a/views/layouts/simple-page.ejs +++ /dev/null @@ -1,27 +0,0 @@ - - -
- - - - - - -- Thank you for using TradeByte -
-