fucking pos. data is working but tailwind is fucked

This commit is contained in:
2025-06-30 13:02:19 -04:00
parent 4798c1139e
commit c3151f380b
27 changed files with 2734 additions and 1792 deletions
+24
View File
@@ -0,0 +1,24 @@
import { db } from "@/db";
import { bb_products } from "@/db/schema";
export async function GET() {
try {
const allProducts = await db.select().from(bb_products).limit(50);
const mapped = allProducts.map((item: any) => ({
id: item.uuid,
name: item.productName,
slug: slugify(item.productName),
...item
}));
return Response.json({ success: true, data: mapped });
} catch (error) {
return Response.json({ success: false, error: String(error) }, { status: 500 });
}
}
function slugify(name: string): string {
return name
.toLowerCase()
.replace(/[^a-z0-9]+/g, '-')
.replace(/(^-|-$)+/g, '');
}