Skip to content

Commit

Permalink
Merge pull request #48 from fabcodingzest/fix_Cart/#29
Browse files Browse the repository at this point in the history
Fix cart/#29
  • Loading branch information
iampavangandhi authored Aug 18, 2020
2 parents 7036d59 + 297178c commit 8b96275
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion helpers/getCompanyNameAndLogo.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = async function getCompanyNameAndLogo(symbol) {
)
.then(async (resp) => {
let companyName = resp.data.Name;
console.log(companyName);
let logoSrc = await axios.get(`https://autocomplete.clearbit.com/v1/companies/suggest?query=:${companyName.split(' ')[0]}`).then((resp) => resp.data[0].logo).catch(err => console.log(err));
return { companyName, logoSrc };
})
Expand Down
2 changes: 1 addition & 1 deletion routes/api/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ router.put("/confirm", ensureAuth, async (req, res) => {
}
);
console.log(updatedUser);
res.redirect("/");
res.redirect("/done");
} catch (err) {
console.error(err);
res.render("error/500");
Expand Down
7 changes: 4 additions & 3 deletions views/cart.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<div class="relative md:ml-56 lg:ml-64 py-6 px-3 w-full">
<div class="mx-auto max-w-6xl flex flex-col w-full px-4 md:py-12 md:px-8 text-gray-800">
<h1 class="text-2xl lg:text-4xl font-bold mt-8 mb-4">Buy Stock</h1>
<form action="/cart/buy" method="POST">
<h1 class="text-2xl lg:text-4xl font-bold mt-8 mb-4 flex">Buy Stock :<input class="bg-gray-300 max-w-sm w-24 ml-2"
type="text" readonly value="<%= symbol %>" id="companySymbol" name="companySymbol" /></h1>
<div class="w-full text-sm lg:text-base border-4">
</div>
<div
Expand All @@ -12,8 +13,8 @@
<div class="text-xs lg:text-lg font-bold flex items-center lg:items-center lg:row-span-2">
<div class="flex flex-col items-center justify-center w-full">
<img class="hidden lg:block h-16" src="<%= logoSrc %> " alt="<%= companyName %>">
<p class="font-medium text-left text-xs md:text-sm lg:text-center lg:text-lg w-full md:break-all"
><%= companyName %></p>
<p class="font-medium text-left text-xs md:text-sm lg:text-center lg:text-lg w-full md:break-all">
<%= companyName %></p>
</div>
</div>
<div
Expand Down

0 comments on commit 8b96275

Please sign in to comment.