diff --git a/app/components/inventory.tsx b/app/components/inventory.tsx index b0cca8f..36b9bc9 100644 --- a/app/components/inventory.tsx +++ b/app/components/inventory.tsx @@ -7,15 +7,15 @@ import { useNotification } from "~/hooks/notification"; export function Inventory({ side }: { side: "T" | "CT" }) { const [loading, setLoading] = useState(true); const [agent, setAgent] = useState({}); - const [gloves, setGloves] = useState({ name: "", color: "", paint_index: 0 }); - const [knife, setKnife] = useState({ name: "", color: "", paint_index: 0 }); + const [gloves, setGloves] = useState({ name: "", color: "", display: "", paint_index: 0, float: 0.0, pattern: 0 }); + const [knife, setKnife] = useState({ name: "", color: "", display: "", paint_index: 0, float: 0.0, pattern: 0 }); const [weapons, setWeapons] = useState([]); const { notify } = useNotification(); useEffect(() => { const fetch_weapons = async () => { let response = await fetch( - `${import.meta.env.VITE_BASE_API_URL}/knife?team=${side}`, + `${import.meta.env.VITE_BASE_API_URL}/skin?team=${side}&category=Knives`, { credentials: "include" }, ) .then((r) => r.json()) @@ -31,10 +31,10 @@ export function Inventory({ side }: { side: "T" | "CT" }) { ); }); - setKnife(response); + setKnife(response[0]); response = await fetch( - `${import.meta.env.VITE_BASE_API_URL}/gloves?team=${side}`, + `${import.meta.env.VITE_BASE_API_URL}/skin?team=${side}&category=Gloves`, { credentials: "include" }, ) .then((r) => r.json()) @@ -50,7 +50,7 @@ export function Inventory({ side }: { side: "T" | "CT" }) { ); }); - setGloves(response) + setGloves(response[0]) setLoading(false); }; @@ -100,11 +100,17 @@ export function Inventory({ side }: { side: "T" | "CT" }) { weapon_id={knife["name"]} color={knife["color"]} paint_index={knife["paint_index"]} + display={knife["display"]} + float={knife["float"]} + pattern={knife["pattern"]} >