We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c96944 commit 99a20aeCopy full SHA for 99a20ae
1 file changed
web/src/hooks/api/useProducts.ts
@@ -12,7 +12,7 @@ import { useEffect, useState } from "react";
12
price: number;
13
};
14
15
- export default function Home() {
+ export default function useProducts() {
16
const [products, setProducts] = useState<Product[]>([]);
17
const [loading, setLoading] = useState(true);
18
const [error, setError] = useState<string | null>(null);
@@ -24,7 +24,7 @@ import { useEffect, useState } from "react";
24
25
console.log("Buscando produtos...");
26
27
- const res = await fetch("http://localhost:8081/products");
+ const res = await fetch("http://localhost:8080/products");
28
29
if (!res.ok) throw new Error("Erro ao buscar produtos");
30
0 commit comments