diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 17ef9e6..b9db7ff 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -13,6 +13,6 @@ jobs: - name: Setup Biome uses: biomejs/setup-biome@v2 with: - version: latest + version: 2.1.1 - name: Run Biome run: biome ci . \ No newline at end of file diff --git a/components/ordercontainer/PackageOrder.tsx b/components/ordercontainer/PackageOrder.tsx index b12a902..3561eb1 100644 --- a/components/ordercontainer/PackageOrder.tsx +++ b/components/ordercontainer/PackageOrder.tsx @@ -5,8 +5,18 @@ import type { IAddOrder } from "../../types/helper"; import CartItem from "../../types/models/CartItem"; import ProductCard from "../productcard/ProductCard"; +type DisplayPackage = { + name: string; + id: string; + default_price: string; + description: string; + price: number; + features: { name: string }[]; + updated: string | number; +}; + type Props = { - displayPackages: any; + displayPackages: DisplayPackage[]; smallScreen: boolean; }; @@ -25,7 +35,7 @@ const PackageOrder = ({ displayPackages, smallScreen }: Props) => { Choose a Package - {displayPackages?.map((displayPackage: any) => { + {displayPackages?.map((displayPackage: DisplayPackage) => { const { name, id, default_price, description, price, features } = displayPackage; return ( diff --git a/lib/google.ts b/lib/google.ts index 26a47f2..d9086d3 100644 --- a/lib/google.ts +++ b/lib/google.ts @@ -30,7 +30,9 @@ export const authenticateGoogle = () => { return auth; }; //adapted from https://gist.github.com/iaincollins/43302ea047d4a77e6605350598d160c1 -export const appendToSpreadSheet = async (toAppend: any[][]) => { +export const appendToSpreadSheet = async ( + toAppend: (string | number | boolean | null | undefined)[][], +) => { const auth = authenticateGoogle(); const sheets = google.sheets("v4"); diff --git a/lib/nodemailer.ts b/lib/nodemailer.ts index 9d173bc..9aad417 100644 --- a/lib/nodemailer.ts +++ b/lib/nodemailer.ts @@ -1,5 +1,5 @@ +import path from "node:path"; import nodemailer from "nodemailer"; -import path from "path"; import pug from "pug"; const transporter = nodemailer.createTransport({ diff --git a/lib/stripe.ts b/lib/stripe.ts index ad3c5c2..17abd7e 100644 --- a/lib/stripe.ts +++ b/lib/stripe.ts @@ -158,11 +158,13 @@ export const createSession = async ( }), ...(coupon === undefined && { allow_promotion_codes: true }), - success_url: `${process.env - .STRIPE_SUCCESS_URL!}?session_id={CHECKOUT_SESSION_ID}`, + success_url: `${ + process.env.STRIPE_SUCCESS_URL + }?session_id={CHECKOUT_SESSION_ID}`, customer_email: email, - cancel_url: `${process.env - .STRIPE_CANCEL_URL!}?session_id={CHECKOUT_SESSION_ID}`, + cancel_url: `${ + process.env.STRIPE_CANCEL_URL + }?session_id={CHECKOUT_SESSION_ID}`, metadata: { orderId: orderId, [CUSTOMER_FRIENDLY_STRIPE_ITEMS_KEY]: JSON.stringify( diff --git a/lib/templates/bankTransfer.pug b/lib/templates/bankTransfer.pug index 7fa0d41..da050d7 100644 --- a/lib/templates/bankTransfer.pug +++ b/lib/templates/bankTransfer.pug @@ -9,7 +9,7 @@ p Price: #{price} p If you wish to continue with your order please transfer #{price} to 02-0112-0140104-04 with the reference #{orderId}. Please put Ryan Guo as the Payee Name. p Afterwards, please pick a time to pick up your order here: -a(href="https://calendly.com/ryanguo02/printing-pick-up") https://calendly.com/ryanguo02/printing-pickup +a(href="https://calendly.com/ryanguo02/printing-pickup") https://calendly.com/ryanguo02/printing-pickup p If you have any issues or queries, please email us at a(href="mailto:primalprintingnz@gmail.com") primalprintingnz@gmail.com | or text us on 02108678038 diff --git a/lib/templates/creditCard.pug b/lib/templates/creditCard.pug index 6c6fdd0..cd09040 100644 --- a/lib/templates/creditCard.pug +++ b/lib/templates/creditCard.pug @@ -9,7 +9,7 @@ p for the items p #{items} p The next step is to pick a collection time for your order using this link: -a(href="https://calendly.com/ryanguo02/printing-pick-up") https://calendly.com/ryanguo02/printing-pickup +a(href="https://calendly.com/ryanguo02/printing-pickup") https://calendly.com/ryanguo02/printing-pickup p If you have any issues, email us at a(href="mailto:primalprintingnz@gmail.com") primalprintingnz@gmail.com diff --git a/pages/api/products.ts b/pages/api/products.ts index 40b582f..2b8297e 100644 --- a/pages/api/products.ts +++ b/pages/api/products.ts @@ -2,7 +2,7 @@ import type { NextApiRequest, NextApiResponse } from "next"; import { z } from "zod"; import { findPrice, getPackages } from "../../lib/stripe"; -const ProductsSchema = z.object({}); // No specific input expected for this handler +const _ProductsSchema = z.object({}); // No specific input expected for this handler export default async function handler( _req: NextApiRequest, @@ -10,14 +10,14 @@ export default async function handler( ) { try { const packages = await getPackages(); - await Promise.all( packages.data.map(async (pack) => { if (!pack.default_price) { throw new Error("Package default price is missing"); } - const price = await findPrice(pack.default_price.toString()); - (pack as any).price = price; // Temporarily cast to any to add price property + (pack as unknown as { price: number | null }).price = await findPrice( + pack.default_price.toString(), + ); }), ); diff --git a/pages/index.tsx b/pages/index.tsx index 9370c2a..f79fbea 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -156,7 +156,7 @@ By Students, For Students🚀💯" return ( + // biome-ignore lint/security/noDangerouslySetInnerHtml: need to do this to allow for newlines in the text from the database dangerouslySetInnerHTML={{ __html: item.Text, }}