mirror of
https://gitea.gofwd.group/dstrawsb/ballistic-builder.git
synced 2025-12-06 02:36:44 -05:00
adding dynamic filters
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { db } from '@db/index';
|
||||
import { psa } from '@schemas/schema';
|
||||
import { bb_products, psa } from '@schemas/schema';
|
||||
import { eq, lt, gte, ne, and, like } from 'drizzle-orm';
|
||||
import CATEGORY from '@src/data/parts_cats.json';
|
||||
|
||||
@@ -69,6 +69,17 @@ export async function getARHandGuards(page = 1) {
|
||||
.offset(offset);
|
||||
}
|
||||
|
||||
export async function getSuppressors(page = 1) {
|
||||
const limit = 40;
|
||||
const offset = (page - 1) * limit;
|
||||
|
||||
return await db.select()
|
||||
.from(bb_products)
|
||||
.limit(limit)
|
||||
.where(and(eq(bb_products.category, "Muzzle Devices"), eq(bb_products.subcategory, 'Suppressors')))
|
||||
.offset(offset);
|
||||
}
|
||||
|
||||
export async function getAKHandGuards(page = 1) {
|
||||
const limit = 40;
|
||||
const offset = (page - 1) * limit;
|
||||
|
||||
Reference in New Issue
Block a user