From 6c7b7472fdc6d8cba567572d63eb02ea2bab0032 Mon Sep 17 00:00:00 2001 From: Sean S Date: Thu, 12 Dec 2024 10:34:50 -0500 Subject: [PATCH] product with links --- src/app/Products/lowers/page.tsx | 68 +++++++++++++++++++------------- src/db/queries/PSA/index.ts | 21 +++++----- 2 files changed, 51 insertions(+), 38 deletions(-) diff --git a/src/app/Products/lowers/page.tsx b/src/app/Products/lowers/page.tsx index 5d6ee24..feae6ba 100644 --- a/src/app/Products/lowers/page.tsx +++ b/src/app/Products/lowers/page.tsx @@ -1,36 +1,48 @@ import { Button } from "@components/ui/button"; -import { getPSA, getLowerBuildKits, getAKBarreledReceivers } from "@queries/PSA"; -import { psa } from '@db/schema/Psa'; -import styles from '../styles.module.css'; +import { getPSA, getLowerBuildKits, getARCompleteLowers } from "@queries/PSA"; +import { psa } from "@db/schema/Psa"; +import styles from "../styles.module.css"; +import PageHero from "@components/PageHero"; +import Link from "next/link"; export default async function LowerReceiverPage() { - const psa = await getLowerBuildKits(); + const psa = await getARCompleteLowers(); return ( -
- - - - - - - - - - - {psa.map((psa) => ( - - - - - +
+ +
+
ComponentManufacturerModel #Price
{psa.category}{psa.brandName}{psa.modelnumber} - ${Number(psa.salePrice).toFixed(2)} - -
+ + + + + + - ))} - -
ComponentManufacturerModel #Price
+ + + {psa.map((psa) => ( + + {psa.category} + {psa.brandName} + {psa.modelnumber} + + ${Number(psa.salePrice).toFixed(2)} + {/* I dont think this is exactly correct but works for now? */} + + + + + + ))} + + +
); -} \ No newline at end of file +} diff --git a/src/db/queries/PSA/index.ts b/src/db/queries/PSA/index.ts index 939f96d..a5abc57 100644 --- a/src/db/queries/PSA/index.ts +++ b/src/db/queries/PSA/index.ts @@ -24,19 +24,20 @@ export async function getLowerBuildKits(page = 1) { .offset(offset); } -export async function getAKBarreledReceivers(page = 1) { - const limit = 20; - const offset = (page - 1) * limit; +// DISABLING FOR NOW. NO NEED FOR AK. FOCUS ON AR15 +// export async function getAKBarreledReceivers(page = 1) { +// const limit = 20; +// const offset = (page - 1) * limit; - return await db.select() - .from(psa) - .limit(limit) - .where(eq(psa.fineline, "AK Barreled Receivers")) - .offset(offset); -} +// return await db.select() +// .from(psa) +// .limit(limit) +// .where(eq(psa.fineline, "AK Barreled Receivers")) +// .offset(offset); +// } export async function getARCompleteLowers(page = 1) { - const limit = 20; + const limit = 40; const offset = (page - 1) * limit; return await db.select()