mirror of
https://gitea.gofwd.group/dstrawsb/ballistic-builder.git
synced 2025-12-06 02:36:44 -05:00
lots of stuff
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { db } from '../../index';
|
||||
import { psa } from '../../../drizzle/schema';
|
||||
import { eq, lt, gte, ne } from 'drizzle-orm';
|
||||
import CATEGORY from '@src/data/parts_cats.json';
|
||||
|
||||
export async function getPSA(page = 1) {
|
||||
const limit = 20;
|
||||
@@ -24,18 +25,6 @@ export async function getLowerBuildKits(page = 1) {
|
||||
.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) {
|
||||
const limit = 40;
|
||||
const offset = (page - 1) * limit;
|
||||
@@ -46,3 +35,14 @@ export async function getARCompleteLowers(page = 1) {
|
||||
.where(eq(psa.fineline, "AR Complete Lowers"))
|
||||
.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);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// db/queries.ts
|
||||
"use server";
|
||||
import { eq, not , asc} from "drizzle-orm";
|
||||
import { Product } from '../../schema/Product'
|
||||
import { Product } from '@schemas/Product';
|
||||
import { db } from '../../index';
|
||||
|
||||
// Fetch all account
|
||||
// Fetch all products
|
||||
export async function getAllProducts() {
|
||||
return await db.select().from(Product);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user