lots of stuff

This commit is contained in:
2024-12-12 16:23:05 -05:00
parent c2a195268b
commit e247810ab5
13 changed files with 686 additions and 684 deletions

View File

@@ -0,0 +1,37 @@
import { Button } from "@components/ui/button";
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';
export default async function GripsPage() {
const psa = await getProductType(partTypes["AR PARTS"]);
return (
<div className="container mx-auto">
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
<thead>
<tr className={styles.tr}>
<th>Component</th>
<th>Manufacturer</th>
<th>Model #</th>
<th>Price</th>
</tr>
</thead>
<tbody>
{psa.map((psa) => (
<tr key={psa.upc}>
<td>{psa.category}</td>
<td>{psa.brandName}</td>
<td>{psa.modelnumber}</td>
<td className="flex items-center gap-2">
${Number(psa.salePrice).toFixed(2)}
<Button variant="outline">Buy</Button>
</td>
</tr>
))}
</tbody>
</table>
</div>
);
}

View File

@@ -0,0 +1,37 @@
import { Button } from "@components/ui/button";
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';
export default async function GripsPage() {
const psa = await getProductType(partTypes["AR PARTS"]);
return (
<div className="container mx-auto">
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
<thead>
<tr className={styles.tr}>
<th>Component</th>
<th>Manufacturer</th>
<th>Model #</th>
<th>Price</th>
</tr>
</thead>
<tbody>
{psa.map((psa) => (
<tr key={psa.upc}>
<td>{psa.category}</td>
<td>{psa.brandName}</td>
<td>{psa.modelnumber}</td>
<td className="flex items-center gap-2">
${Number(psa.salePrice).toFixed(2)}
<Button variant="outline">Buy</Button>
</td>
</tr>
))}
</tbody>
</table>
</div>
);
}

View File

@@ -0,0 +1,37 @@
import { Button } from "@components/ui/button";
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';
export default async function GripsPage() {
const psa = await getProductType(partTypes["AR PARTS"]);
return (
<div className="container mx-auto">
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
<thead>
<tr className={styles.tr}>
<th>Component</th>
<th>Manufacturer</th>
<th>Model #</th>
<th>Price</th>
</tr>
</thead>
<tbody>
{psa.map((psa) => (
<tr key={psa.upc}>
<td>{psa.category}</td>
<td>{psa.brandName}</td>
<td>{psa.modelnumber}</td>
<td className="flex items-center gap-2">
${Number(psa.salePrice).toFixed(2)}
<Button variant="outline">Buy</Button>
</td>
</tr>
))}
</tbody>
</table>
</div>
);
}

View File

@@ -1,12 +1,13 @@
import { Button } from "@components/ui/button"; import { Button } from "@components/ui/button";
import { getPSA, getLowerBuildKits, getARCompleteLowers } from "@queries/PSA"; import { getPSA, getLowerBuildKits, getARCompleteLowers, getProductType } from "@queries/PSA";
import partTypes from 'src/data/parts_cats.json';
import { psa } from "@db/schema/Psa"; import { psa } from "@db/schema/Psa";
import styles from "../styles.module.css"; import styles from "../styles.module.css";
import PageHero from "@components/PageHero"; import PageHero from "@components/PageHero";
import Link from "next/link"; import Link from "next/link";
export default async function LowerReceiverPage() { export default async function LowerReceiverPage() {
const psa = await getARCompleteLowers(); const psa = await getProductType(partTypes["AR COMPLETE LOWERS"]);
return ( return (
<div> <div>

View File

@@ -0,0 +1,37 @@
import { Button } from "@components/ui/button";
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';
export default async function GripsPage() {
const psa = await getProductType(partTypes["AR PARTS"]);
return (
<div className="container mx-auto">
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
<thead>
<tr className={styles.tr}>
<th>Component</th>
<th>Manufacturer</th>
<th>Model #</th>
<th>Price</th>
</tr>
</thead>
<tbody>
{psa.map((psa) => (
<tr key={psa.upc}>
<td>{psa.category}</td>
<td>{psa.brandName}</td>
<td>{psa.modelnumber}</td>
<td className="flex items-center gap-2">
${Number(psa.salePrice).toFixed(2)}
<Button variant="outline">Buy</Button>
</td>
</tr>
))}
</tbody>
</table>
</div>
);
}

View File

@@ -0,0 +1,37 @@
import { Button } from "@components/ui/button";
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';
export default async function GripsPage() {
const psa = await getProductType(partTypes["AR PARTS"]);
return (
<div className="container mx-auto">
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
<thead>
<tr className={styles.tr}>
<th>Component</th>
<th>Manufacturer</th>
<th>Model #</th>
<th>Price</th>
</tr>
</thead>
<tbody>
{psa.map((psa) => (
<tr key={psa.upc}>
<td>{psa.category}</td>
<td>{psa.brandName}</td>
<td>{psa.modelnumber}</td>
<td className="flex items-center gap-2">
${Number(psa.salePrice).toFixed(2)}
<Button variant="outline">Buy</Button>
</td>
</tr>
))}
</tbody>
</table>
</div>
);
}

View File

@@ -0,0 +1,37 @@
import { Button } from "@components/ui/button";
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';
export default async function GripsPage() {
const psa = await getProductType(partTypes["AR PARTS"]);
return (
<div className="container mx-auto">
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
<thead>
<tr className={styles.tr}>
<th>Component</th>
<th>Manufacturer</th>
<th>Model #</th>
<th>Price</th>
</tr>
</thead>
<tbody>
{psa.map((psa) => (
<tr key={psa.upc}>
<td>{psa.category}</td>
<td>{psa.brandName}</td>
<td>{psa.modelnumber}</td>
<td className="flex items-center gap-2">
${Number(psa.salePrice).toFixed(2)}
<Button variant="outline">Buy</Button>
</td>
</tr>
))}
</tbody>
</table>
</div>
);
}

View File

@@ -0,0 +1,37 @@
import { Button } from "@components/ui/button";
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';
export default async function GripsPage() {
const psa = await getProductType(partTypes["AR PARTS"]);
return (
<div className="container mx-auto">
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
<thead>
<tr className={styles.tr}>
<th>Component</th>
<th>Manufacturer</th>
<th>Model #</th>
<th>Price</th>
</tr>
</thead>
<tbody>
{psa.map((psa) => (
<tr key={psa.upc}>
<td>{psa.category}</td>
<td>{psa.brandName}</td>
<td>{psa.modelnumber}</td>
<td className="flex items-center gap-2">
${Number(psa.salePrice).toFixed(2)}
<Button variant="outline">Buy</Button>
</td>
</tr>
))}
</tbody>
</table>
</div>
);
}

View File

@@ -42,20 +42,20 @@ const navigation = {
name: 'Lower Parts', name: 'Lower Parts',
items: [ items: [
{ name: 'Lower Receivers', href: '/Products/lowers' }, { name: 'Lower Receivers', href: '/Products/lowers' },
{ name: 'Grips', href: '#' }, { name: 'Grips', href: '/Products/grips' },
{ name: 'Stocks', href: '#' }, { name: 'Stocks', href: '/Products/stocks' },
{ name: 'Triggers', href: '#' }, { name: 'Triggers', href: '/Products/triggers' },
{ name: 'Parts', href: '#' }, { name: 'Parts', href: '/Products/parts' },
], ],
}, },
{ {
id: 'upper-parts', id: 'upper-parts',
name: 'Upper Parks', name: 'Upper Parks',
items: [ items: [
{ name: 'Upper Receiver', href: '#' }, { name: 'Upper Receiver', href: '/Products/uppers' },
{ name: 'Barrels', href: '#' }, { name: 'Barrels', href: '/Products/barrels' },
{ name: 'Handguards', href: '#' }, { name: 'Handguards', href: '/Products/handguards' },
{ name: 'Muzzle Devices', href: '#' }, { name: 'Muzzle Devices', href: '/Products/muzzle-devices' },
], ],
}, },
{ {

View File

@@ -1,394 +0,0 @@
/* {
"name" : "Fixed Blade Knives"
},
{
"name" : "Reloading Primers"
},
{
"name" : "Archery"
},
{
"name" : "Parts Kits"
},
{
"name" : "Reloading Shellholders & Shellplates"
},
{
"name" : "Railed Uppers"
},
{
"name" : "Reloading Case Length Gauges"
},
{
"name" : "Gun Cases & Safes"
},
{
"name" : "Multi Tools"
},
{
"name" : "Reloading Benches & Stands"
},
{
"name" : "Bipods & Tripods"
},
{
"name" : "Magnifiers"
},
{
"name" : "Door Mats"
},
{
"name" : "Reloading Case Cleaning & Preparation"
},
{
"name" : "Handgun Magazines"
},
{
"name" : "Laser Sights"
},
{
"name" : "Ankle Holster"
},
{
"name" : "Outside Waistband Holster"
},
{
"name" : "Brass Catchers"
},
{
"name" : "Wallets"
},
{
"name" : "Self-Defense"
},
{
"name" : "Premium Uppers"
},
{
"name" : "Reloading Priming Tools"
},
{
"name" : "Reloading Loader Kits"
},
{
"name" : "Binoculars"
},
{
"name" : "Holster Accessories"
},
{
"name" : "Belts"
},
{
"name" : "Scopes"
},
{
"name" : "Backpacks"
},
{
"name" : "Batteries"
},
{
"name" : "Health & Safety"
},
{
"name" : "Reloading Manuals & Reference Materials"
},
{
"name" : "Spotting Scopes"
},
{
"name" : "Pocket Holster"
},
{
"name" : "Vehicle Accessories"
},
{
"name" : "Ammunition Carriers"
},
{
"name" : "Handgun Ammunition"
},
{
"name" : "Classic Uppers"
},
{
"name" : "Ak Pistols"
},
{
"name" : "Phone Accessories"
},
{
"name" : "Inside & Outside Waistband Holster"
},
{
"name" : "Muzzle Devices"
},
{
"name" : "Scope Accessories"
},
{
"name" : "Sunglasses"
},
{
"name" : "Revolver Clips"
},
{
"name" : "Magazine Accessories"
},
{
"name" : "Reloading Trays"
},
{
"name" : "Rifle Parts"
},
{
"name" : "Tactical"
},
{
"name" : "Novelties"
},
{
"name" : "Pouches"
},
{
"name" : "Rifle Magazines"
},
{
"name" : "Snap Caps"
},
{
"name" : ""
},
{
"name" : "Reloading Meplat Uniformers & Trimmers"
},
{
"name" : "Ar Gunsmithing"
},
{
"name" : "Handcuffs"
},
{
"name" : "Headwear"
},
{
"name" : "Thigh Holster"
},
{
"name" : "Rifle Ammunition"
},
{
"name" : "Shotguns"
},
{
"name" : "Reloading Bullet Pullers"
},
{
"name" : "Knife Accessories"
},
{
"name" : "Shotgun Ammunition"
},
{
"name" : "Handguns"
},
{
"name" : "Lights"
},
{
"name" : "Ar Parts"
},
{
"name" : "Airguns"
},
{
"name" : "Moe Uppers"
},
{
"name" : "Shotgun Parts"
},
{
"name" : "Rifles"
},
{
"name" : "Tapes"
},
{
"name" : "Shovels"
},
{
"name" : "Storage Boxes"
},
{
"name" : "Tactical Pens"
},
{
"name" : "Targets"
},
{
"name" : "Shooting Rests"
},
{
"name" : "Breaching Tools"
},
{
"name" : "Eye & Ear Protection"
},
{
"name" : "Flame Throwers"
},
{
"name" : "Rangefinders"
},
{
"name" : "Reloading Bullet Casting"
},
{
"name" : "Knife Kits & Sets"
},
{
"name" : "Reloading Bullets"
},
{
"name" : "Ar Lowers"
},
{
"name" : "Handgun Frames"
},
{
"name" : "Reloading Shotshell Components"
},
{
"name" : "Guides, Manuals & Reference"
},
{
"name" : "Reloading Die Parts & Accessories"
},
{
"name" : "Reloading Powder Measures, Scales & Tools"
},
{
"name" : "Ak Parts"
},
{
"name" : "Bags"
},
{
"name" : "Machetes"
},
{
"name" : "Thermal & Night Vision"
},
{
"name" : "Folding Knives"
},
{
"name" : "Rimfire Ammunition"
},
{
"name" : "Reloading Brass"
},
{
"name" : "Reloading Calipers & Micrometers"
},
{
"name" : "Cleaning & Finishing"
},
{
"name" : "Axes & Hatchets"
},
{
"name" : "Reloading Shotshell Equipment"
},
{
"name" : "Karambit Knives"
},
{
"name" : "Throwing Blades"
},
{
"name" : "Handgun Parts"
},
{
"name" : "Reloading Press Accessories"
},
{
"name" : "Ak Rifles"
},
{
"name" : "Vises & Clamps"
},
{
"name" : "Shooting Pads"
},
{
"name" : "Reloading Ammo Boxes & Labels"
},
{
"name" : "Reloading Dies"
},
{
"name" : "B5 Systems Uppers"
},
{
"name" : "Hand Cleaners"
},
{
"name" : "Patches"
},
{
"name" : "Ar Rifles"
},
{
"name" : "Upper Serialized Receivers"
},
{
"name" : "Shoulder Holster"
},
{
"name" : "Tools"
},
{
"name" : "Optic Accessories"
},
{
"name" : "Ak Magazines"
},
{
"name" : "Red Dot Sights"
},
{
"name" : "Sight Installation & Adjustment"
},
{
"name" : "Ar Magazines"
},
{
"name" : "Reloading Comparators & Concentricity Gauges"
},
{
"name" : "Alternative Carry Holster"
},
{
"name" : "Reloading Presses"
},
{
"name" : "Handgun Gunsmithing"
},
{
"name" : "Tactical Magazines"
},
{
"name" : "Holographic Sights"
},
{
"name" : "Iron Sights"
},
{
"name" : "Shotgun Magazines"
},
{
"name" : "Belly Band Holster"
}
]} */

View File

@@ -1,267 +1,403 @@
{ {
"AR PISTOLS": {"name" : "AR Pistols"}, "AR PISTOLS": {
"INSIDE WAISTBAND HOLSTER": {"name": "Inside Waistband Holster"}, "name": "AR Pistols"
},
"FIXED BLADE KNIVES": {"name" : "Fixed Blade Knives"}, "INSIDE WAISTBAND HOLSTER": {
"name": "Inside Waistband Holster"
"RELOADING PRIMERS": {"name" : "Reloading Primers"}, },
"FIXED BLADE KNIVES": {
"ARCHERY": {"name" : "Archery"}, "name": "Fixed Blade Knives"
},
"PARTS KITS": {"name" : "Parts Kits"}, "RELOADING PRIMERS": {
"name": "Reloading Primers"
"RELOADING SHELLHOLDERS & SHELLPLATES": {"name" :"Reloading Shellholders & Shellplates" }, },
"ARCHERY": {
"RAILED UPPERS": {"name" : "Railed Uppers"}, "name": "Archery"
},
"RELOADING CASE LENGTH GAUGES": {"name" : "Reloading Case Length Gauges"}, "PARTS KITS": {
"name": "Parts Kits"
"GUN CASES & SAFES": {"name" : "Gun Cases & Safes"}, },
"RELOADING SHELLHOLDERS & SHELLPLATES": {
"MULTI TOOLS": {"name" : "Multi Tools"}, "name": "Reloading Shellholders & Shellplates"
},
"RELOADING BENCHES & STANDS": {"name" :"Reloading Benches & Stands" }, "RAILED UPPERS": {
"name": "Railed Uppers"
"BIPODS & TRIPODS": {"name" : "Bipods & Tripods"}, },
"RELOADING CASE LENGTH GAUGES": {
"MAGNIFIERS": {"name" :"Magnifiers" }, "name": "Reloading Case Length Gauges"
},
"DOOR MATS": {"name" : "Door Mats"}, "GUN CASES & SAFES": {
"name": "Gun Cases & Safes"
"RELOADING CASE CLEANING & PREPARATION": {"name" : "Reloading Case Cleaning & Preparation":}, },
"MULTI TOOLS": {
"HANDGUN MAGAZINES": {"name" :"Handgun Magazines" }, "name": "Multi Tools"
},
"LASER SIGHTS": {"name" : "Laser Sights"}, "RELOADING BENCHES & STANDS": {
"name": "Reloading Benches & Stands"
"ANKLE HOLSTER": {"name" : "Ankle Holster"}, },
"BIPODS & TRIPODS": {
"OUTSIDE WAISTBAND HOLSTER": {"name" :"Outside Waistband Holster" }, "name": "Bipods & Tripods"
},
"BRASS CATCHERS": {"name" : "Brass Catchers"}, "MAGNIFIERS": {
"name": "Magnifiers"
"WALLETS": {"name" : "Wallets"}, },
"DOOR MATS": {
"SELF-DEFENSE": {"name" : "Self-Defense"}, "name": "Door Mats"
},
"PREMIUM UPPERS": {"name" : "Premium Uppers"}, "RELOADING CASE CLEANING & PREPARATION": {
"name": "Reloading Case Cleaning & Preparation"
"RELOADING PRIMING TOOLS": {"name" :"Reloading Priming Tools" }, },
"HANDGUN MAGAZINES": {
"RELOADING LOADER KITS": {"name" : "Reloading Loader Kits"}, "name": "Handgun Magazines"
},
"BINOCULARS": {"name" : "Binoculars"}, "LASER SIGHTS": {
"name": "Laser Sights"
"HOLSTER ACCESSORIES": {"name" : "Holster Accessories"}, },
"ANKLE HOLSTER": {
"BELTS": {"name" :"Belts"}, "name": "Ankle Holster"
},
"SCOPES": {"name" : "Scopes"}, "OUTSIDE WAISTBAND HOLSTER": {
"name": "Outside Waistband Holster"
"BACKPACKS": {"name" :"Backpacks" }, },
"BRASS CATCHERS": {
"BATTERIES": {"name" : "Batteries" }, "name": "Brass Catchers"
},
"HEALTH & SAFETY": {"name" : "Health & Safety"}, "WALLETS": {
"name": "Wallets"
"RELOADING MANUALS & REFERENCE MATERIALS": {"name" : "Reloading Manuals & Reference Materials"}, },
"SELF-DEFENSE": {
"SPOTTING SCOPES": {"name" : "Spotting Scopes"}, "name": "Self-Defense"
},
"POCKET HOLSTER": {"name" : "Pocket Holster"}, "PREMIUM UPPERS": {
"name": "Premium Uppers"
"VEHICLE ACCESSORIES": {"name" : "Vehicle Accessories"}, },
"RELOADING PRIMING TOOLS": {
"AMMUNITION CARRIERS": {"name" : "Ammunition Carriers"}, "name": "Reloading Priming Tools"
},
"HANDGUN AMMUNITION": {"name" : "Handgun Ammunition"}, "RELOADING LOADER KITS": {
"name": "Reloading Loader Kits"
"CLASSIC UPPERS": {"name" : "Classic Uppers" }, },
"BINOCULARS": {
"AK PISTOLS": {"name" : "Ak Pistols"}, "name": "Binoculars"
},
"PHONE ACCESSORIES": {"name" : "Phone Accessories"}, "HOLSTER ACCESSORIES": {
"name": "Holster Accessories"
"INSIDE & OUTSIDE WAISTBAND HOLSTER": {"name" : "Inside & Outside Waistband Holster" }, },
"BELTS": {
"MUZZLE DEVICES": {"name" : "Muzzle Devices"}, "name": "Belts"
},
"SCOPE ACCESSORIES": {"name" :"Scope Accessories" }, "SCOPES": {
"name": "Scopes"
"SUNGLASSES": {"name" : "Sunglasses"}, },
"BACKPACKS": {
"REVOLVER CLIPS": {"name" : "Revolver Clips"}, "name": "Backpacks"
},
"MAGAZINE ACCESSORIES": {"name" : "Magazine Accessories"}, "BATTERIES": {
"name": "Batteries"
"RELOADING TRAYS": {"name" : "Reloading Trays"}, },
"HEALTH & SAFETY": {
"RIFLE PARTS": {"name" : "Rifle Parts"}, "name": "Health & Safety"
},
"TACTICAL": {"name" : "Tactical"}, "RELOADING MANUALS & REFERENCE MATERIALS": {
"name": "Reloading Manuals & Reference Materials"
"NOVELTIES": {"name" : "Novelties"}, },
"SPOTTING SCOPES": {
"POUCHES": {"name" : "Pouches"}, "name": "Spotting Scopes"
},
"RIFLE MAGAZINES": {"name" : "Rifle Magazines"}, "POCKET HOLSTER": {
"name": "Pocket Holster"
"SNAP CAPS": {"name" :"Snap Caps" }, },
"VEHICLE ACCESSORIES": {
"RELOADING MEPLAT UNIFORMERS & TRIMMERS": {"name" :"Reloading Meplat Uniformers & Trimmers" }, "name": "Vehicle Accessories"
},
"AR GUNSMITHING": {"name" : "Ar Gunsmithing"}, "AMMUNITION CARRIERS": {
"name": "Ammunition Carriers"
"HANDCUFFS": {"name" : "Handcuffs"}, },
"HANDGUN AMMUNITION": {
"HEADWEAR": {"name" : "Headwear"}, "name": "Handgun Ammunition"
},
"THIGH HOLSTER": {"name" :"Thigh Holster" }, "CLASSIC UPPERS": {
"name": "Classic Uppers"
"RIFLE AMMUNITION": {"name" : "Rifle Ammunition"}, },
"AK PISTOLS": {
"SHOTGUNS": {"name" : "Shotguns"}, "name": "Ak Pistols"
},
"RELOADING BULLET PULLERS": {"name" : "Reloading Bullet Pullers"}, "PHONE ACCESSORIES": {
"name": "Phone Accessories"
"KNIFE ACCESSORIES": {"name" : "Knife Accessories"}, },
"INSIDE & OUTSIDE WAISTBAND HOLSTER": {
"SHOTGUN AMMUNITION": {"name" : "Shotgun Ammunition"}, "name": "Inside & Outside Waistband Holster"
},
"HANDGUNS": {"name" : "Handguns"}, "MUZZLE DEVICES": {
"name": "Muzzle Devices"
"LIGHTS": {"name" : "Lights"}, },
"SCOPE ACCESSORIES": {
"AR PARTS": {"name" : "Ar Parts"}, "name": "Scope Accessories"
},
"AIRGUNS": {"name" : "Airguns"}, "SUNGLASSES": {
"name": "Sunglasses"
"MOE UPPERS": {"name" : "Moe Uppers"}, },
"REVOLVER CLIPS": {
"SHOTGUN PARTS": {"name" : "Shotgun Parts"}, "name": "Revolver Clips"
},
"RIFLES": {"name" : "Rifles"}, "MAGAZINE ACCESSORIES": {
"name": "Magazine Accessories"
"TAPES": {"name" : "Tapes"}, },
"RELOADING TRAYS": {
"SHOVELS": {"name" : "Shovels"}, "name": "Reloading Trays"
},
"STORAGE BOXES": {"name" : "Storage Boxes"}, "RIFLE PARTS": {
"name": "Rifle Parts"
"TACTICAL PENS": {"name" : "tactical Pens"}, },
"TACTICAL": {
"TARGETS": {"name" : "Targets"}, "name": "Tactical"
},
"SHOOTING RESTS": {"name" : "Shooting Rests"}, "NOVELTIES": {
"name": "Novelties"
"BREACHING TOOLS": {"name" : "Breaching Tools"}, },
"POUCHES": {
"EYE & EAR PROTECTION": {"name" : "Eye & Ear Protection"}, "name": "Pouches"
},
"FLAME THROWERS": {"name" : "Flame Throwers"}, "RIFLE MAGAZINES": {
"name": "Rifle Magazines"
"RANGEFINDERS": {"name" : "Rangefinders"}, },
"SNAP CAPS": {
"RELOADING BULLET CASTING": {"name" :"Reloading Bullet Casting" }, "name": "Snap Caps"
},
"KNIFE KITS & SETS": {"name" : "Knife Kits & Sets"}, "RELOADING MEPLAT UNIFORMERS & TRIMMERS": {
"name": "Reloading Meplat Uniformers & Trimmers"
"RELOADING BULLETS": {"name" : "Reloading Bullets"}, },
"AR GUNSMITHING": {
"AR LOWERS": {"name" : "Ar Lowers"}, "name": "Ar Gunsmithing"
},
"HANDGUN FRAMES": {"name" : "Handgun Frames"}, "HANDCUFFS": {
"name": "Handcuffs"
"RELOADING SHOTSHELL COMPONENTS": {"name" : "Reloading Shotshell Components"}, },
"HEADWEAR": {
"GUIDES, MANUALS & REFERENCE": {"name" : "Guides, Manuals & Reference"}, "name": "Headwear"
},
"RELOADING DIE PARTS & ACCESSORIES": {"name" : "Reloading Die Parts & Accessories"}, "THIGH HOLSTER": {
"name": "Thigh Holster"
"RELOADING POWDER MEASURES, SCALES & TOOLS": {"name" : "Reloading Powder Measures, Scales & Tools"}, },
"RIFLE AMMUNITION": {
"AK PARTS": {"name" : "Ak Parts"}, "name": "Rifle Ammunition"
},
"BAGS": {"name" : "Bags" }, "SHOTGUNS": {
"name": "Shotguns"
"MACHETES": {"name" :"Machetes" }, },
"RELOADING BULLET PULLERS": {
"THERMAL & NIGHT VISION": {"name" :"Thermal & Night Vision" }, "name": "Reloading Bullet Pullers"
},
"FOLDING KNIVES": {"name" : "Folding Knives"}, "KNIFE ACCESSORIES": {
"name": "Knife Accessories"
"RIMFIRE AMMUNITION": {"name" :"Rimfire Ammunition" }, },
"SHOTGUN AMMUNITION": {
"RELOADING BRASS": {"name" :"Reloading Brass" }, "name": "Shotgun Ammunition"
},
"RELOADING CALIPERS & MICROMETERS":{"name" : "Reloading Calipers & Micrometers"}, "HANDGUNS": {
"name": "Handguns"
"CLEANING & FINISHING": {"name" : "Cleaning & Finishing"}, },
"LIGHTS": {
"AXES & HATCHETS": {"name" : "Axes & Hatchets"}, "name": "Lights"
},
"RELOADING SHOTSHELL EQUIPMENT": {"name" : "Reloading Shotshell Equipment"}, "AR PARTS": {
"name": "Ar Parts"
"KARAMBIT KNIVES": {"name" : "Karambit Knives"}, },
"AIRGUNS": {
"THROWING BLADES": {"name" : "Throwing Blades"}, "name": "Airguns"
},
"HANDGUN PARTS": {"name" : "Handgun Parts"}, "MOE UPPERS": {
"name": "Moe Uppers"
"RELOADING PRESS ACCESSORIES": {"name" : "Reloading Press Accessories"}, },
"SHOTGUN PARTS": {
"AK RIFLES": {"name" : "Ak Rifles", "name": "Shotgun Parts"
},
"VISES & CLAMPS": {"name" : "Vises & Clamps"}, "RIFLES": {
"name": "Rifles"
"SHOOTING PADS": {"name" : "Shooting Pads"}, },
"TAPES": {
"RELOADING AMMO BOXES & LABELS": {"name" : "Reloading Ammo Boxes & Labels"}, "name": "Tapes"
},
"RELOADING DIES": {"name" : "Reloading Dies"}, "SHOVELS": {
"name": "Shovels"
"B5 SYSTEMS UPPERS": {"name" : "B5 Systems Uppers"}, },
"STORAGE BOXES": {
"HAND CLEANERS": {"name" : "Hand Cleaners"}, "name": "Storage Boxes"
},
"PATCHES": {"name" : "Patches"}, "TACTICAL PENS": {
"name": "tactical Pens"
"AR RIFLES": {"name" :"Ar Rifles"}, },
"TARGETS": {
"UPPER SERIALIZED RECEIVERS": {"name" : "Upper Serialized Receivers"}, "name": "Targets"
},
"SHOULDER HOLSTER": {"name" :"Shoulder Holster" }, "SHOOTING RESTS": {
"name": "Shooting Rests"
"TOOLS": {"name" : "Tools"}, },
"BREACHING TOOLS": {
"OPTIC ACCESSORIES": {"name" : "Optic Accessories"}, "name": "Breaching Tools"
},
"AK MAGAZINES": {"name" :"Ak Magazines" }, "EYE & EAR PROTECTION": {
"name": "Eye & Ear Protection"
"RED DOT SIGHTS": {"name" : "Red Dot Sights" }, },
"FLAME THROWERS": {
"SIGHT INSTALLATION & ADJUSTMENT": {"name" : "Sight Installation & Adjustment" }, "name": "Flame Throwers"
},
"AR MAGAZINES": {"name" : "Ar Magazines" }, "RANGEFINDERS": {
"name": "Rangefinders"
"RELOADING COMPARATORS & CONCENTRICITY GAUGES": {"name" : "Reloading Comparators & Concentricity Gauges"}, },
"RELOADING BULLET CASTING": {
"ALTERNATIVE CARRY HOLSTER": {"name" : "Alternative Carry Holster"}, "name": "Reloading Bullet Casting"
},
"RELOADING PRESSES": {"name" : "Reloading Presses"}, "KNIFE KITS & SETS": {
"name": "Knife Kits & Sets"
"HANDGUN GUNSMITHING": {"name" :"Handgun Gunsmithing" }, },
"RELOADING BULLETS": {
"TACTICAL MAGAZINES": {"name" : "Tactical Magazines"}, "name": "Reloading Bullets"
},
"HOLOGRAPHIC SIGHTS": {"name" : "Holographic Sights"}, "AR LOWERS": {
"name": "Ar Lowers",
"IRON SIGHTS": {"name" :"Iron Sights" }, "column_name" : "FINELINE"
},
"SHOTGUN MAGAZINES": {"name" :"Shotgun Magazines" }, "AR COMPLETE LOWERS": {
"name": "AR Complete Lowers",
"BELLY BAND HOLSTER": {"name" :"Belly Band Holster" } "column_name" : "FINELINE"
},
"HANDGUN FRAMES": {
"name": "Handgun Frames"
},
"RELOADING SHOTSHELL COMPONENTS": {
"name": "Reloading Shotshell Components"
},
"GUIDES, MANUALS & REFERENCE": {
"name": "Guides, Manuals & Reference"
},
"RELOADING DIE PARTS & ACCESSORIES": {
"name": "Reloading Die Parts & Accessories"
},
"RELOADING POWDER MEASURES, SCALES & TOOLS": {
"name": "Reloading Powder Measures, Scales & Tools"
},
"AK PARTS": {
"name": "Ak Parts"
},
"BAGS": {
"name": "Bags"
},
"MACHETES": {
"name": "Machetes"
},
"THERMAL & NIGHT VISION": {
"name": "Thermal & Night Vision"
},
"FOLDING KNIVES": {
"name": "Folding Knives"
},
"RIMFIRE AMMUNITION": {
"name": "Rimfire Ammunition"
},
"RELOADING BRASS": {
"name": "Reloading Brass"
},
"RELOADING CALIPERS & MICROMETERS": {
"name": "Reloading Calipers & Micrometers"
},
"CLEANING & FINISHING": {
"name": "Cleaning & Finishing"
},
"AXES & HATCHETS": {
"name": "Axes & Hatchets"
},
"RELOADING SHOTSHELL EQUIPMENT": {
"name": "Reloading Shotshell Equipment"
},
"KARAMBIT KNIVES": {
"name": "Karambit Knives"
},
"THROWING BLADES": {
"name": "Throwing Blades"
},
"HANDGUN PARTS": {
"name": "Handgun Parts"
},
"RELOADING PRESS ACCESSORIES": {
"name": "Reloading Press Accessories"
},
"AK RIFLES": {
"name": "Ak Rifles"
},
"VISES & CLAMPS": {
"name": "Vises & Clamps"
},
"SHOOTING PADS": {
"name": "Shooting Pads"
},
"RELOADING AMMO BOXES & LABELS": {
"name": "Reloading Ammo Boxes & Labels"
},
"RELOADING DIES": {
"name": "Reloading Dies"
},
"B5 SYSTEMS UPPERS": {
"name": "B5 Systems Uppers"
},
"HAND CLEANERS": {
"name": "Hand Cleaners"
},
"PATCHES": {
"name": "Patches"
},
"AR RIFLES": {
"name": "Ar Rifles"
},
"UPPER SERIALIZED RECEIVERS": {
"name": "Upper Serialized Receivers"
},
"SHOULDER HOLSTER": {
"name": "Shoulder Holster"
},
"TOOLS": {
"name": "Tools"
},
"OPTIC ACCESSORIES": {
"name": "Optic Accessories"
},
"AK MAGAZINES": {
"name": "Ak Magazines"
},
"RED DOT SIGHTS": {
"name": "Red Dot Sights"
},
"SIGHT INSTALLATION & ADJUSTMENT": {
"name": "Sight Installation & Adjustment"
},
"AR MAGAZINES": {
"name": "Ar Magazines"
},
"RELOADING COMPARATORS & CONCENTRICITY GAUGES": {
"name": "Reloading Comparators & Concentricity Gauges"
},
"ALTERNATIVE CARRY HOLSTER": {
"name": "Alternative Carry Holster"
},
"RELOADING PRESSES": {
"name": "Reloading Presses"
},
"HANDGUN GUNSMITHING": {
"name": "Handgun Gunsmithing"
},
"TACTICAL MAGAZINES": {
"name": "Tactical Magazines"
},
"HOLOGRAPHIC SIGHTS": {
"name": "Holographic Sights"
},
"IRON SIGHTS": {
"name": "Iron Sights"
},
"SHOTGUN MAGAZINES": {
"name": "Shotgun Magazines"
},
"BELLY BAND HOLSTER": {
"name": "Belly Band Holster"
}
}

View File

@@ -1,6 +1,7 @@
import { db } from '../../index'; import { db } from '../../index';
import { psa } from '../../../drizzle/schema'; import { psa } from '../../../drizzle/schema';
import { eq, lt, gte, ne } from 'drizzle-orm'; import { eq, lt, gte, ne } from 'drizzle-orm';
import CATEGORY from '@src/data/parts_cats.json';
export async function getPSA(page = 1) { export async function getPSA(page = 1) {
const limit = 20; const limit = 20;
@@ -24,18 +25,6 @@ export async function getLowerBuildKits(page = 1) {
.offset(offset); .offset(offset);
} }
// 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);
// }
export async function getARCompleteLowers(page = 1) { export async function getARCompleteLowers(page = 1) {
const limit = 40; const limit = 40;
const offset = (page - 1) * limit; const offset = (page - 1) * limit;
@@ -46,3 +35,14 @@ export async function getARCompleteLowers(page = 1) {
.where(eq(psa.fineline, "AR Complete Lowers")) .where(eq(psa.fineline, "AR Complete Lowers"))
.offset(offset); .offset(offset);
} }
export async function getProductType(productType : any, page = 1) {
const limit = 40;
const offset = (page - 1) * limit;
return await db.select()
.from(psa)
.limit(limit)
.where(eq(psa.fineline, productType.name))
.offset(offset);
}

View File

@@ -1,10 +1,10 @@
// db/queries.ts // db/queries.ts
"use server"; "use server";
import { eq, not , asc} from "drizzle-orm"; import { eq, not , asc} from "drizzle-orm";
import { Product } from '../../schema/Product' import { Product } from '@schemas/Product';
import { db } from '../../index'; import { db } from '../../index';
// Fetch all account // Fetch all products
export async function getAllProducts() { export async function getAllProducts() {
return await db.select().from(Product); return await db.select().from(Product);
} }