Skip to content

Commit 32d2118

Browse files
committed
update donate page
1 parent 82e5b39 commit 32d2118

File tree

3 files changed

+32
-31
lines changed

3 files changed

+32
-31
lines changed

index.js

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -859,44 +859,45 @@ app.get("/fundraiser/winter-23/:slug", async (req, res) => {
859859

860860
app.get("/donate", async (req, res) => {
861861

862-
const responseTest = await getDatabaseEntries("16ea90c83765437c86f87bd13a205ca6", [{property:"Date", direction:"descending"}])
863-
const testimonialData = responseTest.map((testimonial) => {
864-
console.log(testimonial)
865-
return parseTestimonials(testimonial)
866-
})
867-
console.log(testimonialData)
862+
// const responseTest = await getDatabaseEntries("16ea90c83765437c86f87bd13a205ca6", [{property:"Date", direction:"descending"}])
863+
// const testimonialData = responseTest.map((testimonial) => {
864+
// console.log(testimonial)
865+
// return parseTestimonials(testimonial)
866+
// })
867+
// console.log(testimonialData)
868868

869-
const response = await getDatabaseEntries(NOTION_STORE_DATABASE_ID, [
870-
{ property: "Name", direction: "descending" },
871-
]);
872-
console.log(response);
869+
// const response = await getDatabaseEntries(NOTION_STORE_DATABASE_ID, [
870+
// { property: "Name", direction: "descending" },
871+
// ]);
872+
// console.log(response);
873873

874-
const productsData = response.map((product) => {
875-
return parseProductData(product);
876-
});
874+
// const productsData = response.map((product) => {
875+
// return parseProductData(product);
876+
// });
877877

878-
const shopifyData = await getShopifyProducts();
878+
// const shopifyData = await getShopifyProducts();
879879

880-
for (const product of productsData) {
881-
const shopifyId = product["Shopify ID"];
880+
// for (const product of productsData) {
881+
// const shopifyId = product["Shopify ID"];
882882

883-
if (!shopifyId) {
884-
continue;
885-
}
883+
// if (!shopifyId) {
884+
// continue;
885+
// }
886886

887-
const node = shopifyData[`gid://shopify/Product/${shopifyId}`];
887+
// const node = shopifyData[`gid://shopify/Product/${shopifyId}`];
888888

889-
if (node) {
890-
product.availableForSale = node.availableForSale;
891-
product.totalInventory = node.totalInventory;
892-
product.availableInventory = node.variants.edges.reduce((accum, val) => {
893-
return accum + val.node.quantityAvailable;
894-
}, 0);
895-
}
896-
}
889+
// if (node) {
890+
// product.availableForSale = node.availableForSale;
891+
// product.totalInventory = node.totalInventory;
892+
// product.availableInventory = node.variants.edges.reduce((accum, val) => {
893+
// return accum + val.node.quantityAvailable;
894+
// }, 0);
895+
// }
896+
// }
897897

898-
console.log(productsData);
899-
res.render("donate/storefront", { products: productsData, testimonials: testimonialData });
898+
// console.log(productsData);
899+
// res.render("donate/storefront", { products: productsData, testimonials: testimonialData });
900+
res.render("donate/storefront");
900901
});
901902

902903

public/images/donate/donate.jpg

175 KB
Loading

public/templates/donate/storefront.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@
240240
<!-- <h4 class="type"><a href="#"></a></h4> -->
241241
<h1>Support School for Poetic Computation!</h1>
242242
<div class="break-noline-small hide-desk"></div>
243-
<img style="margin:1vw; max-height:450px; " src="/images/community/IOTBGU_Project.jpg" />
243+
<img style="margin:1vw; max-height:450px; " src="/images/donate/donate.jpg" />
244244

245245

246246

0 commit comments

Comments
 (0)