mirror of
https://gitea.gofwd.group/dstrawsb/ballistic-builder.git
synced 2025-12-05 18:26:45 -05:00
lots of work
This commit is contained in:
@@ -1,37 +1,41 @@
|
|||||||
import { Button } from "@components/ui/button";
|
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 { psa } from '@db/schema/Psa';
|
||||||
import partTypes from 'src/data/parts_cats.json';
|
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() {
|
export default async function BarrelsPage() {
|
||||||
const psa = await getProductType(partTypes["AR PARTS"]);
|
const psa = await getProductType('Barrels');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container mx-auto">
|
<div>
|
||||||
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
|
<PageHero title="Barrels" />
|
||||||
<thead>
|
<div className="container mx-auto">
|
||||||
<tr className={styles.tr}>
|
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
|
||||||
<th>Component</th>
|
<thead>
|
||||||
<th>Manufacturer</th>
|
<tr className={styles.tr}>
|
||||||
<th>Model #</th>
|
<th className='bg-slate-700 pl-2 w-40'>Component</th>
|
||||||
<th>Price</th>
|
<th className='bg-slate-700 w-40'>Manufacturer</th>
|
||||||
</tr>
|
<th className='bg-slate-700 w-40'>Model #</th>
|
||||||
</thead>
|
<th className='bg-slate-700 w-40'>Price</th>
|
||||||
<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>
|
</tr>
|
||||||
))}
|
</thead>
|
||||||
</tbody>
|
<tbody>
|
||||||
</table>
|
{psa.map((psa) => (
|
||||||
|
<tr key={psa.upc}>
|
||||||
|
<td className='text-slate-800'>{psa.category}</td>
|
||||||
|
<td className='text-slate-800'>{psa.brandName}</td>
|
||||||
|
<td className='text-slate-800'>{psa.modelnumber}</td>
|
||||||
|
<td className="text-slate-800 flex items-center gap-2">
|
||||||
|
${Number(psa.salePrice).toFixed(2)}
|
||||||
|
<Button variant="outline">Buy</Button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,37 +1,41 @@
|
|||||||
import { Button } from "@components/ui/button";
|
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 { psa } from '@db/schema/Psa';
|
||||||
import partTypes from 'src/data/parts_cats.json';
|
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() {
|
export default async function GripsPage() {
|
||||||
const psa = await getProductType(partTypes["AR PARTS"]);
|
const psa = await getGrips();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container mx-auto">
|
<div>
|
||||||
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
|
<PageHero title="AR Grips" />
|
||||||
<thead>
|
<div className="container mx-auto">
|
||||||
<tr className={styles.tr}>
|
<table className="table-auto border-collapse border-spacing-3 border border-slate-500">
|
||||||
<th>Component</th>
|
<thead>
|
||||||
<th>Manufacturer</th>
|
<tr className={styles.tr}>
|
||||||
<th>Model #</th>
|
<th className='bg-slate-700 pl-2 w-40'>Component</th>
|
||||||
<th>Price</th>
|
<th className='bg-slate-700 w-40'>Manufacturer</th>
|
||||||
</tr>
|
<th className='bg-slate-700 w-40'>Model #</th>
|
||||||
</thead>
|
<th className='bg-slate-700 w-20'>Price</th>
|
||||||
<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>
|
</tr>
|
||||||
))}
|
</thead>
|
||||||
</tbody>
|
<tbody>
|
||||||
</table>
|
{psa.map((psa) => (
|
||||||
|
<tr key={psa.upc}>
|
||||||
|
<td className='text-slate-800 pl-2'>{psa.category}</td>
|
||||||
|
<td className='text-slate-800'>{psa.brandName}</td>
|
||||||
|
<td className='text-slate-800'>{psa.modelnumber}</td>
|
||||||
|
<td className="text-slate-800 flex items-center gap-2">
|
||||||
|
${Number(psa.salePrice).toFixed(2)}
|
||||||
|
<Button variant="outline">Buy</Button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,37 +1,41 @@
|
|||||||
import { Button } from "@components/ui/button";
|
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 { psa } from '@db/schema/Psa';
|
||||||
import partTypes from 'src/data/parts_cats.json';
|
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() {
|
export default async function HamdGuardsPage() {
|
||||||
const psa = await getProductType(partTypes["AR PARTS"]);
|
const psa = await getARHandGuards();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container mx-auto">
|
<div>
|
||||||
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
|
<PageHero title="Hand Guards" />
|
||||||
<thead>
|
<div className="container mx-auto">
|
||||||
<tr className={styles.tr}>
|
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
|
||||||
<th>Component</th>
|
<thead>
|
||||||
<th>Manufacturer</th>
|
<tr className={styles.tr}>
|
||||||
<th>Model #</th>
|
<th className='bg-slate-700 pl-2 w-40'>Component</th>
|
||||||
<th>Price</th>
|
<th className='bg-slate-700 w-40'>Manufacturer</th>
|
||||||
</tr>
|
<th className='bg-slate-700 w-40'>Model #</th>
|
||||||
</thead>
|
<th className='bg-slate-700 w-40'>Price</th>
|
||||||
<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>
|
</tr>
|
||||||
))}
|
</thead>
|
||||||
</tbody>
|
<tbody>
|
||||||
</table>
|
{psa.map((psa) => (
|
||||||
|
<tr key={psa.upc}>
|
||||||
|
<td className='text-slate-800'>{psa.category}</td>
|
||||||
|
<td className='text-slate-800'>{psa.brandName}</td>
|
||||||
|
<td className='text-slate-800'>{psa.modelnumber}</td>
|
||||||
|
<td className='text-slate-800 flex items-center gap-2'>
|
||||||
|
${Number(psa.salePrice).toFixed(2)}
|
||||||
|
<Button variant="outline">Buy</Button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Button } from "@components/ui/button";
|
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 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";
|
||||||
|
|||||||
@@ -1,37 +1,41 @@
|
|||||||
import { Button } from "@components/ui/button";
|
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 { psa } from '@db/schema/Psa';
|
||||||
import partTypes from 'src/data/parts_cats.json';
|
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() {
|
export default async function MuzzleDevices() {
|
||||||
const psa = await getProductType(partTypes["AR PARTS"]);
|
const psa = await getMuzzleDevices();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container mx-auto">
|
<div>
|
||||||
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
|
<PageHero title="Muzzle Devices" />
|
||||||
<thead>
|
<div className="container mx-auto">
|
||||||
<tr className={styles.tr}>
|
<table className="table-auto border-separate border-spacing-4 border border-slate-500">
|
||||||
<th>Component</th>
|
<thead>
|
||||||
<th>Manufacturer</th>
|
<tr className={styles.tr}>
|
||||||
<th>Model #</th>
|
<th className='bg-slate-700 pl-2 w-40'>Component</th>
|
||||||
<th>Price</th>
|
<th className='bg-slate-700 w-40'>Manufacturer</th>
|
||||||
</tr>
|
<th className='bg-slate-700 w-40'>Model #</th>
|
||||||
</thead>
|
<th className='bg-slate-700 w-20'>Price</th>
|
||||||
<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>
|
</tr>
|
||||||
))}
|
</thead>
|
||||||
</tbody>
|
<tbody>
|
||||||
</table>
|
{psa.map((psa) => (
|
||||||
|
<tr key={psa.upc}>
|
||||||
|
<td className='text-slate-800'>{psa.category}</td>
|
||||||
|
<td className='text-slate-800'>{psa.brandName}</td>
|
||||||
|
<td className='text-slate-800'>{psa.modelnumber}</td>
|
||||||
|
<td className='text-slate-800 flex items-center gap-2'>
|
||||||
|
${Number(psa.salePrice).toFixed(2)}
|
||||||
|
<Button variant="outline">Buy</Button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,37 +1,41 @@
|
|||||||
import { Button } from "@components/ui/button";
|
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 { psa } from '@db/schema/Psa';
|
||||||
import partTypes from 'src/data/parts_cats.json';
|
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() {
|
export default async function StocksPage() {
|
||||||
const psa = await getProductType(partTypes["AR PARTS"]);
|
const psa = await getStocks();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container mx-auto">
|
<div>
|
||||||
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
|
<PageHero title="Stocks" />
|
||||||
<thead>
|
<div className="container mx-auto">
|
||||||
<tr className={styles.tr}>
|
<table className="table-auto border-separate border-spacing-4 border border-slate-500">
|
||||||
<th>Component</th>
|
<thead>
|
||||||
<th>Manufacturer</th>
|
<tr className={styles.tr}>
|
||||||
<th>Model #</th>
|
<th className='bg-slate-700 pl-2 w-40'>Component</th>
|
||||||
<th>Price</th>
|
<th className='bg-slate-700 w-40'>Manufacturer</th>
|
||||||
</tr>
|
<th className='bg-slate-700 w-40'>Model #</th>
|
||||||
</thead>
|
<th className='bg-slate-700 w-20'>Price</th>
|
||||||
<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>
|
</tr>
|
||||||
))}
|
</thead>
|
||||||
</tbody>
|
<tbody>
|
||||||
</table>
|
{psa.map((psa) => (
|
||||||
|
<tr key={psa.upc}>
|
||||||
|
<td className='text-slate-800'>{psa.category}</td>
|
||||||
|
<td className='text-slate-800'>{psa.brandName}</td>
|
||||||
|
<td className='text-slate-800'>{psa.modelnumber}</td>
|
||||||
|
<td className='text-slate-800 flex items-center gap-2'>
|
||||||
|
${Number(psa.salePrice).toFixed(2)}
|
||||||
|
<Button variant="outline">Buy</Button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -6,4 +6,7 @@
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
background-color: cadetblue;
|
background-color: cadetblue;
|
||||||
|
}
|
||||||
|
.td {
|
||||||
|
color : "stone-700";
|
||||||
}
|
}
|
||||||
@@ -1,30 +1,33 @@
|
|||||||
import { Button } from "@components/ui/button";
|
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 { psa } from '@db/schema/Psa';
|
||||||
import partTypes from 'src/data/parts_cats.json';
|
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() {
|
export default async function TriggersPage() {
|
||||||
const psa = await getProductType(partTypes["AR PARTS"]);
|
const psa = await getARTriggers();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<div>
|
||||||
|
<PageHero title="AR Triggers" />
|
||||||
<div className="container mx-auto">
|
<div className="container mx-auto">
|
||||||
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
|
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
|
||||||
<thead>
|
<thead>
|
||||||
<tr className={styles.tr}>
|
<tr className={styles.tr}>
|
||||||
<th>Component</th>
|
<th className='bg-slate-700 w-40 pl-2'>Component</th>
|
||||||
<th>Manufacturer</th>
|
<th className='bg-slate-700 w-40'>Manufacturer</th>
|
||||||
<th>Model #</th>
|
<th className='bg-slate-700 w-40'>Model #</th>
|
||||||
<th>Price</th>
|
<th className='bg-slate-700 w-40'>Price</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{psa.map((psa) => (
|
{psa.map((psa) => (
|
||||||
<tr key={psa.upc}>
|
<tr key={psa.upc}>
|
||||||
<td>{psa.category}</td>
|
<td className='text-slate-800'>{psa.category}</td>
|
||||||
<td>{psa.brandName}</td>
|
<td className='text-slate-800'>{psa.brandName}</td>
|
||||||
<td>{psa.modelnumber}</td>
|
<td className='text-slate-800'>{psa.modelnumber}</td>
|
||||||
<td className="flex items-center gap-2">
|
<td className='text-slate-800 flex items-center gap-2'>
|
||||||
${Number(psa.salePrice).toFixed(2)}
|
${Number(psa.salePrice).toFixed(2)}
|
||||||
<Button variant="outline">Buy</Button>
|
<Button variant="outline">Buy</Button>
|
||||||
</td>
|
</td>
|
||||||
@@ -33,5 +36,6 @@ export default async function GripsPage() {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,36 +1,40 @@
|
|||||||
import { Button } from "@components/ui/button";
|
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 { 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() {
|
export default async function UpperReceiverPage() {
|
||||||
const psa = await getLowerBuildKits();
|
const psa = await getUpperReciever();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container mx-auto">
|
<div>
|
||||||
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
|
<PageHero title="Upper Recievers" />
|
||||||
<thead>
|
<div className="container mx-auto">
|
||||||
<tr className={styles.tr}>
|
<table className={"table-auto border-separate border-spacing-4 border border-slate-500"}>
|
||||||
<th>Component</th>
|
<thead>
|
||||||
<th>Manufacturer</th>
|
<tr className={styles.tr}>
|
||||||
<th>Model #</th>
|
<th className='bg-slate-700 w-40 pl-2'>Component</th>
|
||||||
<th>Price</th>
|
<th className='bg-slate-700 w-40'>Manufacturer</th>
|
||||||
</tr>
|
<th className='bg-slate-700 w-40'>Model #</th>
|
||||||
</thead>
|
<th className='bg-slate-700 w-20'>Price</th>
|
||||||
<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>
|
</tr>
|
||||||
))}
|
</thead>
|
||||||
</tbody>
|
<tbody>
|
||||||
</table>
|
{psa.map((psa) => (
|
||||||
|
<tr key={psa.upc}>
|
||||||
|
<td className='text-slate-800'>{psa.category}</td>
|
||||||
|
<td className='text-slate-800'>{psa.brandName}</td>
|
||||||
|
<td className='text-slate-800'>{psa.modelnumber}</td>
|
||||||
|
<td className='text-slate-800 flex items-center gap-2'>
|
||||||
|
${Number(psa.salePrice).toFixed(2)}
|
||||||
|
<Button variant="outline">Buy</Button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
1050
src/data/fineline.json
Normal file
1050
src/data/fineline.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
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, and, like } from 'drizzle-orm';
|
||||||
import CATEGORY from '@src/data/parts_cats.json';
|
import CATEGORY from '@src/data/parts_cats.json';
|
||||||
|
|
||||||
export async function getPSA(page = 1) {
|
export async function getPSA(page = 1) {
|
||||||
@@ -43,6 +43,93 @@ export async function getProductType(productType : any, page = 1) {
|
|||||||
return await db.select()
|
return await db.select()
|
||||||
.from(psa)
|
.from(psa)
|
||||||
.limit(limit)
|
.limit(limit)
|
||||||
.where(eq(psa.fineline, productType.name))
|
.where(eq(psa.fineline, (typeof(productType) !== 'string' ? productType.name : productType)))
|
||||||
.offset(offset);
|
.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);
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@ export async function getAllProducts() {
|
|||||||
|
|
||||||
// Add a new product
|
// Add a new product
|
||||||
export async function addProduct() {
|
export async function addProduct() {
|
||||||
return await db.insert(Product).values({}).returning();
|
return await db.insert(Product).values({ }).returning();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update a Product
|
// Update a Product
|
||||||
|
|||||||
Reference in New Issue
Block a user