fixes, more fixes

This commit is contained in:
2024-12-16 00:25:35 -05:00
parent 76a144111d
commit 813688dee2
14 changed files with 37 additions and 37 deletions

View File

@@ -1,5 +1,5 @@
import { db } from '../../index';
import { psa } from '../../../drizzle/schema';
import { psa } from '@schemas/Psa';
import { eq, lt, gte, ne, and, like } from 'drizzle-orm';
import CATEGORY from '@src/data/parts_cats.json';
@@ -112,6 +112,7 @@ export async function getStocksParts(page = 1) {
.where(eq(psa.fineline, "Stocks"))
.offset(offset);
}
export async function getUpperReciever(page = 1) {
const limit = 40;
const offset = (page - 1) * limit;
@@ -133,6 +134,7 @@ export async function getARTriggers(page = 1) {
.where(and(like(psa.fineline, "%Trigger%"), like(psa.category, "Ar Parts")))
.offset(offset);
}
export async function getARParts(page = 1) {
const limit = 40;
const offset = (page - 1) * limit;
@@ -143,6 +145,7 @@ export async function getARParts(page = 1) {
.where(and(like(psa.fineline, "%Trigger%"), like(psa.category, "Ar Parts")))
.offset(offset);
}
export async function getMags(page = 1) {
const limit = 40;
const offset = (page - 1) * limit;
@@ -150,6 +153,6 @@ export async function getMags(page = 1) {
return await db.select()
.from(psa)
.limit(limit)
.where(and(like(psa.fineline, "%Magazine%"), like(psa.category, "Ar Parts")))
.where(like(psa.superfineline, "%AR Magazines%"))
.offset(offset);
}