diff --git a/src/app/Products/barrels/page.tsx b/src/app/Products/barrels/page.tsx index 75090ac..1066ada 100644 --- a/src/app/Products/barrels/page.tsx +++ b/src/app/Products/barrels/page.tsx @@ -1,37 +1,41 @@ import { Button } from "@components/ui/button"; -import { getPSA, getLowerBuildKits, getProductType} from "@queries/PSA"; +import { getPSA, getLowerBuildKits, getProductType } from "@queries/PSA"; import { psa } from '@db/schema/Psa'; import partTypes from 'src/data/parts_cats.json'; -import styles from '../styles.module.css'; +import styles from '../styles.module.css'; +import PageHero from "@src/components/PageHero"; -export default async function GripsPage() { - const psa = await getProductType(partTypes["AR PARTS"]); +export default async function BarrelsPage() { + const psa = await getProductType('Barrels'); 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)} + + + + ))} + + +
); } \ No newline at end of file diff --git a/src/app/Products/grips/page.tsx b/src/app/Products/grips/page.tsx index 75090ac..c91476a 100644 --- a/src/app/Products/grips/page.tsx +++ b/src/app/Products/grips/page.tsx @@ -1,37 +1,41 @@ import { Button } from "@components/ui/button"; -import { getPSA, getLowerBuildKits, getProductType} from "@queries/PSA"; +import { getPSA, getLowerBuildKits, getGrips } from "@queries/PSA"; import { psa } from '@db/schema/Psa'; import partTypes from 'src/data/parts_cats.json'; -import styles from '../styles.module.css'; +import styles from '../styles.module.css'; +import PageHero from "@src/components/PageHero"; export default async function GripsPage() { - const psa = await getProductType(partTypes["AR PARTS"]); + const psa = await getGrips(); 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)} + + + + ))} + + +
); } \ No newline at end of file diff --git a/src/app/Products/handguards/page.tsx b/src/app/Products/handguards/page.tsx index 75090ac..fec30cf 100644 --- a/src/app/Products/handguards/page.tsx +++ b/src/app/Products/handguards/page.tsx @@ -1,37 +1,41 @@ import { Button } from "@components/ui/button"; -import { getPSA, getLowerBuildKits, getProductType} from "@queries/PSA"; +import { getPSA, getLowerBuildKits, getARHandGuards } from "@queries/PSA"; import { psa } from '@db/schema/Psa'; import partTypes from 'src/data/parts_cats.json'; -import styles from '../styles.module.css'; +import styles from '../styles.module.css'; +import PageHero from "@src/components/PageHero"; -export default async function GripsPage() { - const psa = await getProductType(partTypes["AR PARTS"]); +export default async function HamdGuardsPage() { + const psa = await getARHandGuards(); 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)} + + + + ))} + + +
); } \ No newline at end of file diff --git a/src/app/Products/lowers/page.tsx b/src/app/Products/lowers/page.tsx index 0d81663..e05b765 100644 --- a/src/app/Products/lowers/page.tsx +++ b/src/app/Products/lowers/page.tsx @@ -1,5 +1,5 @@ import { Button } from "@components/ui/button"; -import { getPSA, getLowerBuildKits, getARCompleteLowers, getProductType } from "@queries/PSA"; +import { getARCompleteLowers, getProductType } from "@queries/PSA"; import partTypes from 'src/data/parts_cats.json'; import { psa } from "@db/schema/Psa"; import styles from "../styles.module.css"; diff --git a/src/app/Products/muzzle-devices/page.tsx b/src/app/Products/muzzle-devices/page.tsx index 75090ac..485affd 100644 --- a/src/app/Products/muzzle-devices/page.tsx +++ b/src/app/Products/muzzle-devices/page.tsx @@ -1,37 +1,41 @@ import { Button } from "@components/ui/button"; -import { getPSA, getLowerBuildKits, getProductType} from "@queries/PSA"; +import { getMuzzleDevices } from "@queries/PSA"; import { psa } from '@db/schema/Psa'; import partTypes from 'src/data/parts_cats.json'; -import styles from '../styles.module.css'; +import styles from '../styles.module.css'; +import PageHero from "@src/components/PageHero"; -export default async function GripsPage() { - const psa = await getProductType(partTypes["AR PARTS"]); +export default async function MuzzleDevices() { + const psa = await getMuzzleDevices(); 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)} + + + + ))} + + +
); } \ No newline at end of file diff --git a/src/app/Products/stocks/page.tsx b/src/app/Products/stocks/page.tsx index 75090ac..8d74033 100644 --- a/src/app/Products/stocks/page.tsx +++ b/src/app/Products/stocks/page.tsx @@ -1,37 +1,41 @@ import { Button } from "@components/ui/button"; -import { getPSA, getLowerBuildKits, getProductType} from "@queries/PSA"; +import { getStocks } from "@queries/PSA"; import { psa } from '@db/schema/Psa'; import partTypes from 'src/data/parts_cats.json'; -import styles from '../styles.module.css'; +import styles from '../styles.module.css'; +import PageHero from "@src/components/PageHero"; -export default async function GripsPage() { - const psa = await getProductType(partTypes["AR PARTS"]); +export default async function StocksPage() { + const psa = await getStocks(); 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)} + + + + ))} + + +
); } \ No newline at end of file diff --git a/src/app/Products/styles.module.css b/src/app/Products/styles.module.css index 034b6ed..7e053c5 100644 --- a/src/app/Products/styles.module.css +++ b/src/app/Products/styles.module.css @@ -6,4 +6,7 @@ text-align: left; font-weight: bold; background-color: cadetblue; + } + .td { + color : "stone-700"; } \ No newline at end of file diff --git a/src/app/Products/triggers/page.tsx b/src/app/Products/triggers/page.tsx index 75090ac..95207b6 100644 --- a/src/app/Products/triggers/page.tsx +++ b/src/app/Products/triggers/page.tsx @@ -1,30 +1,33 @@ import { Button } from "@components/ui/button"; -import { getPSA, getLowerBuildKits, getProductType} from "@queries/PSA"; +import { getARTriggers} from "@queries/PSA"; import { psa } from '@db/schema/Psa'; import partTypes from 'src/data/parts_cats.json'; import styles from '../styles.module.css'; +import PageHero from "@src/components/PageHero"; -export default async function GripsPage() { - const psa = await getProductType(partTypes["AR PARTS"]); +export default async function TriggersPage() { + const psa = await getARTriggers(); return ( +
+
- - - - + + + + {psa.map((psa) => ( - - - - + + + @@ -33,5 +36,6 @@ export default async function GripsPage() {
ComponentManufacturerModel #PriceComponentManufacturerModel #Price
{psa.category}{psa.brandName}{psa.modelnumber} + {psa.category}{psa.brandName}{psa.modelnumber} ${Number(psa.salePrice).toFixed(2)}
+
); } \ No newline at end of file diff --git a/src/app/Products/uppers/page.tsx b/src/app/Products/uppers/page.tsx index 35a16d4..2b351d7 100644 --- a/src/app/Products/uppers/page.tsx +++ b/src/app/Products/uppers/page.tsx @@ -1,36 +1,40 @@ import { Button } from "@components/ui/button"; -import { getPSA, getLowerBuildKits, getAKBarreledReceivers } from "@queries/PSA"; +import { getPSA, getUpperReciever } from "@queries/PSA"; import { psa } from '@db/schema/Psa'; -import styles from '../styles.module.css'; +import styles from '../styles.module.css'; +import PageHero from "@src/components/PageHero"; -export default async function LowerReceiverPage() { - const psa = await getLowerBuildKits(); +export default async function UpperReceiverPage() { + const psa = await getUpperReciever(); 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)} + + + + ))} + + +
); } \ No newline at end of file diff --git a/src/data/fineline.json b/src/data/fineline.json new file mode 100644 index 0000000..a9e2554 --- /dev/null +++ b/src/data/fineline.json @@ -0,0 +1,1050 @@ +{ + "RANGE BAGS": { + "name": "Range Bags" + }, + "THERMAL MONOCULARS": { + "name": "Therma Monoculars" + }, + "RELOADING CASE TUMBLER MEDIA & POLISH": { + "name": "Relading Case Tumbler Media & Polish" + }, + "HANDGUN PARTS KITS": { + "name": "Handgu Parts Kits" + }, + "BRASS CLEANING JAGS": { + "name": "BrassCleaning Jags" + }, + "NIGHT VISION SCOPES": { + "name": "NightVision Scopes" + }, + "BACKPACK SLINGS": { + "name": "Backpack lings" + }, + "RIFLE SIGHTS": { + "name": "Rifle Sights" + }, + "XTRACTORS & PARTS": { + "name": "Extracors & Parts" + }, + "CASTLE NUTS": { + "name": "Castle Nuts" + }, + "MAAZINE BASEPLATES": { + "name": "Magazne Baseplates" + }, + "PUNCH SETS": { + "name": "Punch Sets" + }, + "FIEL & REPAIR KITS": { + "name": "Field& Repair Kits" + }, + "AR COMPLETE LOWERS": { + "name": "AR Comlete Lowers" + }, + "BOLT CARRIER GROUPS": { + "name": "Bolt arrier Groups" + }, + "BELT POUCHES": { + "name": "Belt Pouches" + }, + "RAINING BLADES": { + "name": "Training lades" + }, + "SIGHT PUSHERS": { + "name": "Sight Pushes" + }, + "POCKET KNIVES": { + "name": "Pocket Knivs" + }, + "SHOTGUN CASES": { + "name": "Shotgun Cass" + }, + "MAGAZINE CAPS": { + "name": "Magazine Cas" + }, + "DRILL BITS & SCREWDRIVERS": { + "name": "Drill Bits & Scewdrivers" + }, + "RIFLE SCOPES": { + "name": "Rifle Scopes" + }, + "LINGS": { + "name": "Slings" + }, + "FILES & ENGRVING TOOLS": { + "name": "Fles & Engraving Tools" + }, + "BARREL NUTS & PARTS": { + "name": "Barre Nuts & Parts" + }, + "FIRING PINS": { + "name": "Firing Pins" + }, + "REOADING RIFLE KITS": { + "name": "Reloding Rifle Kits" + }, + "SHOULDER PADS": { + "name": "Shoulder Pas" + }, + "COMPENSATORS": { + "name": "Compensators" + }, + "DECALS": { + "name": "Decals" + }, + "BOWIE KNIVES": { + "name": "Bowie Knives" + }, + "HANDCUFF ACCESSORIES": { + "name": "Handuff Accessories" + }, + "CHARGING HANDLES": { + "name": "ChargingHandles" + }, + "RELOADING SEATER PLUG": { + "name": "Relading Seater Plg" + }, + "GAS SYSTEM ASSEMBLIES": { + "name": "GasSystem Assemblis" + }, + "PISTOLS": { + "name": "Pistols" + }, + "GUIDE RODS& PARTS": { + "name": "Guide ods & Parts" + }, + "DELTA RING PARTS": { + "name": "Delta Rig Parts" + }, + "EARMUFFS AND GLASSES": { + "name": "Earmffs and Glasses" + }, + "RELOADING SHOTSHELL PRESS PARTS & ACCESSORES": { + "name": "Reloading Shotshell Press Parts & Accessories" + }, + "MEDICAL BACKPACKS": { + "name": "MedicalBackpacks" + }, + "TRIPODS": { + "name": "Tripods" + }, + "SHELL POUCES": { + "name": "Shell Pouchs" + }, + "BATONS": { + "name": "Batons" + }, + "CLEANIG ROD & BORE GUIDES": { + "name": "Cleaning Rods & Bore Guides" + }, + "FIRESTARTERS": { + "name": "Firestarters" + }, + "PPER & LOWER PARTS": { + "name": "Upper& Lower Parts" + }, + "THERMAL SCOPES": { + "name": "Thermal Scpes" + }, + "RELOADING SHOTSHELL WADS": { + "name": "eloading Shotshll Wads" + }, + "SCOPE TOOLS": { + "name": "Scope Tools" + }, + "MUZLE DEVICE PARTS": { + "name": "Muzzl Device Parts" + }, + "GAUGES, RULERS, SQUARES & LEVELS": { + "name": "Gauges, ulers, Squares & Levels" + }, + "RELOADING SHOTSHELL PRESSES & TOOLS": { + "name": "Reloaing Shotshell Presses & Tools" + }, + "MONOPODS": { + "name": "Monopods" + }, + "PISTOL KTS": { + "name": "Pistol Kits" + }, + "REPLCEMENT BLADES": { + "name": "Replacment Blades" + }, + "GUN SAFES": { + "name": "Gun Safes" + }, + "SWORDS": { + "name": "Swords" + }, + "SPRINGS & PARS": { + "name": "Springs &Parts" + }, + "RELOADING PRIMER POCKET & FLASH HOLE TOOLS": { + "name": "Reloading Primer Pocket & Flash Hole Tools" + }, + "BACKPACK PANELS": { + "name": "Backpack anels" + }, + "BUTTERFLY KNIVES": { + "name": "Butterfl Knives" + }, + "BORE TOOLS": { + "name": "Bore Tools" + }, + "AK ION SIGHTS": { + "name": "AK Iron Sihts" + }, + "HUNTING KNIVES": { + "name": "Hunting Knves" + }, + "RANGEFINDER BINOCULARS": { + "name": "Ragefinder Binocuars" + }, + "SHEATHS": { + "name": "Sheaths" + }, + "NIGHT VISIN MONOCULARS": { + "name": "Nght Vision Monoculars" + }, + "SHARPENING TOOLS": { + "name": "Sharpenig Tools" + }, + "SLIDE PARTS": { + "name": "Slide Parts" + }, + { + "SCEWS": { + "name": "Screws" + }, + "NIGHT VISIONBINOCULARS": { + "name": "Nght Vision Binoculars" + }, + "RELOADING BULLET & INGOT MOLDS": { + "name": "Reloading ullet & Ingot Molds" + }, + "AMMUNITION POUCHES": { + "name": "Ammuniion Pouches" + }, + "SHOT SHELL CARRIERS": { + "name": "Shot hell Carriers" + }, + "GRENADE POUCHES": { + "name": "Grenade Puches" + }, + "CLEANING BRUSHES & TOOLS": { + "name": "leaning Brushes& Tools" + }, + "STOCKS": { + "name": "Stocks" + }, + "HANDGUN SIGHS": { + "name": "Handgun Sihts" + }, + "MAGAZINE FOLLOWERS": { + "name": "Magazie Followers" + }, + "RELOADING BULLET LUBES": { + "name": "Reoading Bullet Lbes" + }, + "EARBUDS": { + "name": "Earbuds" + }, + "PHONE CASE": { + "name": "Phone Cases" + }, + { + "RELOADING POWDER MEASURES": { + "name": "ReloadingPowde Measures" + } + }, + { + "FRAME PARTS": { + "name": "Frame Parts", + }, + { + "FOWARD ASSIST PARTS": { + "name": "Forwrd Assist Parts" + } + }, + { + "LASER SIGHT ACCESSORIES": { + "name": "Lser Sight Accesories" + } + }, + { + "SPACERS": { + "name": "Spacers" + } + }, + { + "BUFFER TUBS & BUFFER TUBE ASSEMBLY PARTS": { + "name": "Buffer Tubes & Buffer Tube Assembly Parts" + } + }, + { + "FINISHING SUPPLIES": { + "name": "Finishng Supplis" + } + }, + { + "PHONE POUCHES": { + "name": "Phone Pouchs" + } + }, + { + "CLEANING CLOTHS, WIPES & PATCHES": { + "name": "CleaningCloths, Wipes & Patches" + } + }, + { + "FLASH HIDERS": { + "name": "Flash Hiders" + } + }, + { + "URNITURE SETS": { + "name": "Furniture ets" + } + }, + { + "MAGAZINE SPEED LOADERS": { + "name": "Maazine Speed Loaers" + } + }, + { + "LEVEL 2 RETENTION HOLSTER": { + "name": "Level 2 Retentin Holster" + } + }, + { + "DISPOSABLE BAGS": { + "name": "Disposabl Bags" + } + }, + { + "SHOOTING BENCHES": { + "name": "ShootingBenches" + } + } + { + "CLEANING MATS": { + "name": "Cleaning Mas" + } + }, + { + "MULTIPURPOSE BAGS": { + "name": "Multipupose Bags" + } + }, + { + "SUPPRESSOR MOUNTS": { + "name": "Suppresor Mounts" + } + }, + { + "TOMAHAWKS": { + "name": "Tomahawks" + } + }, + { + "PAPER ARGETS": { + "name": "Paper Targes" + } + }, + { + "RIFLE CASES": { + "name": "Rifle Cases" + } + }, + { + "SCPE COVERS & SHADES": { + "name": "Scoe Covers & Shads" + } + }, + { + "SPRINGS & SPRING KITS": { + "name": "Sprngs & Spring Kis" + } + }, + { + "SCOPE RINGS": { + "name": "Scope Rings", + }, + { + "DIPLAY SUPPRESSORS": { + "name": "Disply Suppressors" + } + }, + { + "GUN SOCKS": { + "name": "Gun Socks" + } + }, + { + "MAGAZIE GRIP EXTENDERS": { + "name": "Mgazine Grip Exteders" + } + }, + { + "SCOPE BASES": { + "name": "Scope Bases" + } + }, + { + "AI GUN SCOPES": { + "name": "Air Gun Scpes" + } + }, + { + "SAWS": { + "name": "Saws" + } + }, + { + "ARGET THROWERS": { + "name": "Target Thowers" + } + }, + { + "DERRINGER": { + "name": "Derringer" + } + }, + { + "RELOADNG CASE LUBRICATION": { + "name": "Reloading Case ubrication" + } + }, + { + "CONVERSION KITS": { + "name": "Conversio Kits" + } + }, + { + "TRIGGERS": { + "name": "Triggers" + } + }, + { + "BATON HODERS": { + "name": "Baton Holdes" + } + }, + { + "ORE CLEANERS": { + "name": "Bore Cleanes" + } + }, + { + "TACTICAL RIFLES": { + "name": "Tactical ifles" + } + }, + { + "SLING SWIVELS": { + "name": "Sling Swives" + } + }, + { + "CHOKE TUBES": { + "name": "Choke Tubes", + }, + { + "BOESNAKES & ROPES": { + "name": "Boresnkes & Ropes" + } + }, + { + "AMMUNITION CASES": { + "name": "Ammunitin Cases" + } + } + { + "HAMMERS & PARTS": { + "name": "Hammers &Parts" + } + }, + { + "REVOLVERS": { + "name": "Revolvers" + } + }, + { + "STRIPPD UPPER RECEIVERS": { + "name": "tripped Upper Reeivers" + } + }, + { + "RELOADING PISTOL KITS": { + "name": "Relading Pistol Kis" + } + }, + { + "SCOPE LEVELS": { + "name": "Scope Levels" + } + }, + { + "ORESIGHTS": { + "name": "Boresights" + } + }, + { + "LEVE 1 RETENTION HOLSTER": { + "name": "Level 1 Retentin Holster" + } + }, + { + "TRIGGER SPRINGS & PARTS": { + "name": "Tigger Springs &Parts" + } + }, + { + "HANDGUN SCOPES": { + "name": "Handgun Scpes" + } + }, + { + "SCOPE MOUNTS": { + "name": "Scope Mounts" + } + }, + { + "UKRI MACHETES": { + "name": "Kukri Machtes" + } + }, + { + "TRIGGER GUARDS": { + "name": "Trigger Gurds" + } + }, + { + "GUN DISPLAYS": { + "name": "Gun Displays" + } + }, + { + "INOCULAR ACCESSORIES": { + "name": "Bincular Accessoris" + } + }, + { + "RANGEFINDER MONOCULARS": { + "name": "Ragefinder Monocuars" + } + }, + { + "RED DOT MOUNTS": { + "name": "Red Dot Monts" + } + }, + { + "DEFENSIVE SHOTGUNS": { + "name": "Defensve Shotguns" + } + }, + { + "1911": { + "name": "1911" + } + }, + { + "ROSSBOW SCOPES": { + "name": "Crossbow copes" + } + }, + { + "SAFETY SELECTOR PARTS": { + "name": "Safty Selector Pars" + } + }, + { + "STOCK PARTS": { + "name": "Stock Parts" + } + }, + { + "TATICAL PISTOLS": { + "name": "TacticalPistols" + } + }, + { + "RELOADING SHOTSHELL SHOT & SLUGS": { + "name": "Reloadin Shotshell Shot & Slugs" + } + }, + { + "RELOADING EXPANDER-DECAPPING UNITS": { + "name": "Reloadng Expander-Decapping Units" + } + }, + { + "SURVIVAL KNIVES": { + "name": "Survival nives" + } + }, + { + "MAGAZINE EXTENSIONS": { + "name": "Magazne Extensions" + } + }, + { + "RELOADING BULLET LUBE & SIZER DIES": { + "name": "Reloadng Bullet Lube & Sizer Dies" + } + }, + { + "MAGAZINE CONVERSION KITS": { + "name": "agazine Converson Kits" + } + }, + { + "LAPTOP BACKPACKS": { + "name": "Laptop Bckpacks" + } + } + { + "TRIGGER PINS": { + "name": "Trigger Pins" + } + }, + { + "ACTICAL SHOTGUNS": { + "name": "Tactica Shotguns" + } + }, + { + "WAIST POUCHES": { + "name": "Waist Pouchs" + } + }, + { + "RELOADING POWDER SCALES": { + "name": "Rloading Powder cales" + } + }, + { + "AMMUNITION BAGS": { + "name": "Ammunitio Bags" + } + }, + { + "BIPODS": { + "name": "Bipods" + } + }, + { + "ARMORER'S KI": { + "name": "Armorer's Kt" + } + }, + { + "EARMUFFS": { + "name": "Earmuffs" + } + } + { + "BATTERY HARGERS": { + "name": "Battery hargers" + } + }, + { + "LEVEL 3 RETENTION HOLSTER": { + "name": "Level 3 Retentin Holster" + } + }, + { + "BOLT ACTIONS & HANDLES": { + "name": "Bot Actions & Hanles" + } + }, + { + "EARPLUGS AND GLASSES": { + "name": "Earpugs and Glasses" + } + }, + { + "BOOT KNIVES": { + "name": "Boot Knives" + } + }, + { + "TAGET STANDS": { + "name": "Target Stans" + } + }, + { + "UPPER BULD KITS": "nme": "Upper Buld Kits" + } + }, + { + "ILLUMINATORS": { + "name": "Illuminators" + } + }, + { + "ELOADING POWDER TRICKLERS": { + "name": "Reloading Powdr Tricklers" + } + }, + { + "GLASSES": { + "name": "Glasses" + } + }, + { + "AR STRIPPE LOWERS": { + "name": "AR Strpped Lowers" + } + }, + { + "MAGAZINE MAGWELL ADAPTERS": { + "name": "Magazine agWel Adapters" + } + }, + { + "PLAYING CARDS": { + "name": "Playing Cars" + } + }, + { + "THERMAL BINOCULARS": { + "name": "Therma Binoculars" + } + }, + { + "SHOTGUN SIGHTS": { + "name": "Shotgun Sihts" + } + }, + { + "DEFENSE SPRAYS": { + "name": "Defense Spays" + } + }, + { + "UPPER PARTS KITS": { + "name": "Upper Pats Kits" + } + } + { + "RELOADING CASE NECK TURNERS & REAMERS": { + "name": "Relading Case Neck Turners & Reamers" + } + }, + { + "MAGAZINE LIMITERS": { + "name": "Magazin Limiters" + } + }, + { + "BIOMETRIC GUN SAFES": { + "name": "Biomeric Gun Safes" + } + }, + { + "MAGAZINE HOLDERS & POUCHES": { + "name": "Magazine Holdes & Pouches" + } + }, + { + "TARGET HANGERS": { + "name": "Target Haners" + } + }, + { + "SPOTTING SCOPE TRIPOD & MOUNTS": { + "name": "Spotting Sope Tripod & Mounts" + } + }, + { + "BAYONET": { + "name": "Bayonet" + } + }, + { + "BACKPACK ISERTS": { + "name": "BackpackInserts" + } + }, + { + "WRENCHES": { + "name": "Wrenches" + } + }, + { + "REOADIN CHAMFER & DEBURRING TOOLS": { + "name": "Reloadig Chamfer & Deburring Tools" + } + }, + { + "RADIO POUCHES": { + "name": "Radio Pouchs" + } + }, + { + "MEASURING TAPES": { + "name": "MeasuringTapes" + } + }, + { + "EARPLUGS": { + "name": "Earplugs" + } + }, + { + "DAGGER KIVES": { + "name": "Dagger Knivs" + } + }, + { + "ALIPERS, MICROMETERS & DIAL INDICATORS": { + "name": "Clipers, Micrometers & Dial Indicators" + } + }, + { + "LIGHT POUCHES": { + "name": "Light Pouchs" + } + }, + { + "THERMAL ACCESSORIES": { + "name": "Therml Accessories" + } + }, + { + "RELOADING POWDER FUNNELS": { + "name": "eloading PowderFunnels" + } + }, + { + "REVOLVER CYLINDERS": { + "name": "Revolvr Cylinders" + } + }, + { + "MAG RELEASES & PARTS": { + "name": "Mag eleases & Parts" + } + }, + { + "BORE BRUSHES": { + "name": "Bore Brushes" + } + }, + { + "OLT CATCH PARTS": { + "name": "Bolt Cath Parts" + } + }, + { + "TACTICAL BACKPACKS": { + "name": "Tacticl Backpacks" + } + }, + { + "GRIPS": { + "name": "Grips" + } + }, + { + "UTILITY POUCHE": { + "name": "Utility Puches" + } + }, + { + "FILLET KNIVES": { + "name": "Fillet Knivs" + } + }, + { + "LOWER PARTS KITS": { + "name": "Lower Pats Kits" + } + }, + { + "PUSH KNIVES": { + "name": "Push Knives" + } + }, + { + "REOADING BULLET PULLER COLLETS": { + "name": "ReloadingBullet Puller Collets" + } + }, + { + "MAGAZINE MAG WELL ADAPTERS": { + "name": "Magazine Mag Wll Adapters" + } + }, + { + "SHOOTING BAGS": { + "name": "Shooting Bas" + } + }, + { + "TACTICAL KNIVES": { + "name": "Tactical nives" + } + }, + { + "SHOOTING MATS": { + "name": "Shooting Mas" + } + }, + { + "SLIDES": { + "name": "Slides" + } + }, + { + "BARRELS": { + "name": "Barrels" + } + }, + { + "LOWER BUILD KITS": { + "name": "Lower Buld Kits" + } + }, + { + "EJECTION PORT COVER PARTS": { + "name": "Ejection ort Cver Parts" + } + }, + { + "ARMORER'S WRENCHES": { + "name": "Armore's Wrenches" + } + }, + { + "RIFLE KITS": { + "name": "Rifle Kits" + } + }, + { + "AK BRRELED RECEIVERS": { + "name": "AK arreled Receives" + } + }, + { + "THERMAL RANGEFINDERS": { + "name": "Theral Rangefinders" + } + }, + { + "NIGHT VISION ACCESSORIES": { + "name": "ight Vision Accssories" + } + }, + { + "MEDICAL POUCHES": { + "name": "Medical Puches" + } + }, + { + "HANDGUARDS & RAIL SYSTEMS": { + "name": "Handguards & Ral Systems" + } + }, + { + "GUN CLEANERS, OILS & LUBRICANTS": { + "name": "Gun Cleanrs, Oils & Lubricants" + } + }, + { + "SPORTING SHOTGUNS": { + "name": "Sportin Shotguns" + } + }, + { + "STEEL TARGETS": { + "name": "Steel Targes" + } + }, + { + "RELOADING CASE TRIMMERS & PREP CENTERS": { + "name": "Reoading Case Trimmers & Prep Centers" + } + }, + { + "KITCHEN KNIVES": { + "name": "Kitchen Knves" + } + }, + { + "PISTOL CASES": { + "name": "Pistol Cases" + } + }, + { + "UN LOCKS": { + "name": "Gun Locks" + } + }, + { + "FLASHLGHTS": { + "name": "Flashlights" + } + }, + { + "SHOLDER BAGS": { + "name": "Shoulder Bas" + } + }, + { + "RELOADING CASE TUMBLERS & PARTS": { + "name": "ReloadingCase Tumblers & Parts" + } + }, + { + "HAMMERS": { + "name": "Hammers" + } + }, + { + "CLEANING KTS": { + "name": "Cleaning Kis" + } + }, + { + "MUZZLE BRAKES": { + "name": "Muzzle Braks" + } + }, + { + "TACTICAL LOWERS": { + "name": "Tactical owers" + } + }, + { + "CHAMBER BRUSHES": { + "name": "Chamber Bushes" + } + }, + { + "SHOTGUN SCOPES": { + "name": "Shotgun Scpes" + } + }, + { + "AR IRON SIGHTS": { + "name": "AR Iron Sihts" + } + }, + { + "TAKEDOWN PINS": { + "name": "Takedown Pis" + } + }, + { + "AR BARRELED RECEIVERS": { + "name": "AR arreled Receives" + } + }, + { + "RELOADING COLLETS": { + "name": "Reloadig Collets" + } + } \ No newline at end of file diff --git a/src/db/queries/PSA/index.ts b/src/db/queries/PSA/index.ts index 8376b55..a869112 100644 --- a/src/db/queries/PSA/index.ts +++ b/src/db/queries/PSA/index.ts @@ -1,6 +1,6 @@ import { db } from '../../index'; import { psa } from '../../../drizzle/schema'; -import { eq, lt, gte, ne } from 'drizzle-orm'; +import { eq, lt, gte, ne, and, like } from 'drizzle-orm'; import CATEGORY from '@src/data/parts_cats.json'; export async function getPSA(page = 1) { @@ -43,6 +43,93 @@ export async function getProductType(productType : any, page = 1) { return await db.select() .from(psa) .limit(limit) - .where(eq(psa.fineline, productType.name)) + .where(eq(psa.fineline, (typeof(productType) !== 'string' ? productType.name : productType))) .offset(offset); } + +export async function getGrips(page = 1) { + const limit = 40; + const offset = (page - 1) * limit; + + return await db.select() + .from(psa) + .limit(limit) + .where(eq(psa.fineline, "Grips")) + .offset(offset); +} + +export async function getARHandGuards(page = 1) { + const limit = 40; + const offset = (page - 1) * limit; + + return await db.select() + .from(psa) + .limit(limit) + .where(and(eq(psa.fineline, "Handguards & Rail Systems"), eq(psa.category, 'Ar Parts'))) + .offset(offset); +} + +export async function getAKHandGuards(page = 1) { + const limit = 40; + const offset = (page - 1) * limit; + + return await db.select() + .from(psa) + .limit(limit) + .where(and(eq(psa.fineline, "Handguards & Rail Systems"), eq(psa.category, 'Ak Parts'))) + .offset(offset); +} + +export async function getMuzzleDevices(page = 1) { + const limit = 40; + const offset = (page - 1) * limit; + + return await db.select() + .from(psa) + .limit(limit) + .where(eq(psa.fineline, "Muzzle Brakes")) + .offset(offset); +} + +export async function getStocks(page = 1) { + const limit = 40; + const offset = (page - 1) * limit; + + return await db.select() + .from(psa) + .limit(limit) + .where(eq(psa.fineline, "Stocks")) + .offset(offset); +} + +export async function getStocksParts(page = 1) { + const limit = 40; + const offset = (page - 1) * limit; + + return await db.select() + .from(psa) + .limit(limit) + .where(eq(psa.fineline, "Stocks")) + .offset(offset); +} +export async function getUpperReciever(page = 1) { + const limit = 40; + const offset = (page - 1) * limit; + + return await db.select() + .from(psa) + .limit(limit) + .where(like(psa.fineline, "%Upper Receivers")) + .offset(offset); +} + +export async function getARTriggers(page = 1) { + const limit = 40; + const offset = (page - 1) * limit; + + return await db.select() + .from(psa) + .limit(limit) + .where(and(like(psa.fineline, "%Trigger%"), like(psa.category, "Ar Parts"))) + .offset(offset); +} \ No newline at end of file diff --git a/src/db/queries/Products/index.ts b/src/db/queries/Products/index.ts index b2127a2..b79d8f1 100644 --- a/src/db/queries/Products/index.ts +++ b/src/db/queries/Products/index.ts @@ -11,7 +11,7 @@ export async function getAllProducts() { // Add a new product export async function addProduct() { - return await db.insert(Product).values({}).returning(); + return await db.insert(Product).values({ }).returning(); } // Update a Product