mirror of
https://gitea.gofwd.group/dstrawsb/ballistic-builder.git
synced 2025-12-06 02:36:44 -05:00
more fises
This commit is contained in:
@@ -26,7 +26,7 @@ export async function getLowerBuildKits(page = 1) {
|
||||
}
|
||||
|
||||
export async function getARCompleteLowers(page = 1) {
|
||||
const limit = 40;
|
||||
const limit = 240;
|
||||
const offset = (page - 1) * limit;
|
||||
|
||||
return await db.select()
|
||||
@@ -39,7 +39,7 @@ export async function getARCompleteLowers(page = 1) {
|
||||
export async function getProductType(productType : any, page = 1) {
|
||||
const limit = 40;
|
||||
const offset = (page - 1) * limit;
|
||||
|
||||
await new Promise((resolve) => setTimeout(resolve,1000));
|
||||
return await db.select()
|
||||
.from(psa)
|
||||
.limit(limit)
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
// db/queries.ts
|
||||
"use server";
|
||||
import { eq, not , asc} from "drizzle-orm";
|
||||
import { Product } from '@schemas/Product';
|
||||
import { products } from '@schemas/schema';
|
||||
import { db } from '../../index';
|
||||
|
||||
// Fetch all products
|
||||
export async function getAllProducts() {
|
||||
return await db.select().from(Product);
|
||||
return await db.select().from(products);
|
||||
}
|
||||
|
||||
// Add a new product
|
||||
export async function addProduct() {
|
||||
return await db.insert(Product).values({ }).returning();
|
||||
return await db.insert(products).values({ }).returning();
|
||||
}
|
||||
|
||||
// Update a Product
|
||||
export async function updateProduct( ) {
|
||||
return await db.update(Product).set({ }).where(eq(Product.id, id));
|
||||
return await db.update(products).set({ }).where(eq(Product.id, id));
|
||||
}
|
||||
|
||||
// Delete a product
|
||||
export async function deleteProduct(id: number) {
|
||||
return await db.delete(Product).where(eq(Product.id, id));
|
||||
return await db.delete(products).where(eq(products.id, id));
|
||||
}
|
||||
Reference in New Issue
Block a user