full app is using live data now,

This commit is contained in:
2025-11-30 21:08:13 -05:00
parent d53a58e994
commit c858835044
111 changed files with 1551 additions and 644 deletions
+5 -7
View File
@@ -9,11 +9,9 @@ import type { CategoryId, Part } from "@/types/gunbuilder";
type ViewMode = "card" | "list";
type GunbuilderProductFromApi = {
id: number;
uuid: string;
slug: string;
id: string; // backend UUID as string
name: string;
brandName: string;
brand: string; // backend brand field
platform: string;
partRole: string;
price: number | null;
@@ -79,13 +77,13 @@ export default function CategoryPage() {
const data: GunbuilderProductFromApi[] = await res.json();
// 🔑 Normalize into your Part type using *id* and *brand*
const normalized: Part[] = data.map((p) => ({
id: p.uuid,
id: p.id, // ✅ backend id (UUID string)
categoryId,
name: p.name,
brand: p.brandName,
brand: p.brand, // ✅ backend brand
price: p.price ?? 0,
// these fields exist in the Part type even if youre not using them yet
imageUrl: p.mainImageUrl ?? undefined,
url: p.buyUrl ?? undefined,
notes: undefined,