This commit is contained in:
2024-12-12 00:04:14 -05:00
parent 1691c60d96
commit e36bbe1165
5 changed files with 85 additions and 11 deletions

View File

@@ -1,12 +1,47 @@
import { db } from '../../index';
import { psa } from '../../../drizzle/schema';
import { eq, lt, gte, ne } from 'drizzle-orm';
export async function getPSA(page = 1) {
const limit = 10;
const limit = 20;
const offset = (page - 1) * limit;
return await db.select()
.from(psa)
.limit(limit)
.where(eq(psa.fineline, "Lower Build Kits"))
.offset(offset);
}
}
export async function getLowerBuildKits(page = 1) {
const limit = 20;
const offset = (page - 1) * limit;
return await db.select()
.from(psa)
.limit(limit)
.where(eq(psa.fineline, "Lower Build Kits"))
.offset(offset);
}
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 = 20;
const offset = (page - 1) * limit;
return await db.select()
.from(psa)
.limit(limit)
.where(eq(psa.fineline, "AR Complete Lowers"))
.offset(offset);
}